Search in sources :

Example 1 with Delete

use of io.prestosql.sql.tree.Delete in project hetu-core by openlookeng.

the class TestSqlParser method testDelete.

@Test
public void testDelete() {
    assertStatement("DELETE FROM t", new Delete(table(QualifiedName.of("t")), Optional.empty()));
    assertStatement("DELETE FROM \"awesome table\"", new Delete(table(QualifiedName.of("awesome table")), Optional.empty()));
    assertStatement("DELETE FROM t WHERE a = b", new Delete(table(QualifiedName.of("t")), Optional.of(new ComparisonExpression(ComparisonExpression.Operator.EQUAL, new Identifier("a"), new Identifier("b")))));
}
Also used : Delete(io.prestosql.sql.tree.Delete) ComparisonExpression(io.prestosql.sql.tree.ComparisonExpression) QuantifiedComparisonExpression(io.prestosql.sql.tree.QuantifiedComparisonExpression) Identifier(io.prestosql.sql.tree.Identifier) QueryUtil.quotedIdentifier(io.prestosql.sql.QueryUtil.quotedIdentifier) Test(org.testng.annotations.Test)

Aggregations

QueryUtil.quotedIdentifier (io.prestosql.sql.QueryUtil.quotedIdentifier)1 ComparisonExpression (io.prestosql.sql.tree.ComparisonExpression)1 Delete (io.prestosql.sql.tree.Delete)1 Identifier (io.prestosql.sql.tree.Identifier)1 QuantifiedComparisonExpression (io.prestosql.sql.tree.QuantifiedComparisonExpression)1 Test (org.testng.annotations.Test)1