Search in sources :

Example 1 with Delete

use of io.trino.sql.tree.Delete in project trino by trinodb.

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.trino.sql.tree.Delete) MergeDelete(io.trino.sql.tree.MergeDelete) QuantifiedComparisonExpression(io.trino.sql.tree.QuantifiedComparisonExpression) ComparisonExpression(io.trino.sql.tree.ComparisonExpression) QueryUtil.quotedIdentifier(io.trino.sql.QueryUtil.quotedIdentifier) Identifier(io.trino.sql.tree.Identifier) Test(org.junit.jupiter.api.Test)

Aggregations

QueryUtil.quotedIdentifier (io.trino.sql.QueryUtil.quotedIdentifier)1 ComparisonExpression (io.trino.sql.tree.ComparisonExpression)1 Delete (io.trino.sql.tree.Delete)1 Identifier (io.trino.sql.tree.Identifier)1 MergeDelete (io.trino.sql.tree.MergeDelete)1 QuantifiedComparisonExpression (io.trino.sql.tree.QuantifiedComparisonExpression)1 Test (org.junit.jupiter.api.Test)1