use of io.trino.sql.tree.TableExecute in project trino by trinodb.
the class TestSqlParser method testTableExecute.
@Test
public void testTableExecute() {
Table table = new Table(QualifiedName.of("foo"));
Identifier procedure = new Identifier("bar");
assertStatement("ALTER TABLE foo EXECUTE bar", new TableExecute(table, procedure, ImmutableList.of(), Optional.empty()));
assertStatement("ALTER TABLE foo EXECUTE bar(bah => 1, wuh => 'clap') WHERE age > 17", new TableExecute(table, procedure, ImmutableList.of(new CallArgument(identifier("bah"), new LongLiteral("1")), new CallArgument(identifier("wuh"), new StringLiteral("clap"))), Optional.of(new ComparisonExpression(ComparisonExpression.Operator.GREATER_THAN, new Identifier("age"), new LongLiteral("17")))));
assertStatement("ALTER TABLE foo EXECUTE bar(1, 'clap') WHERE age > 17", new TableExecute(table, procedure, ImmutableList.of(new CallArgument(new LongLiteral("1")), new CallArgument(new StringLiteral("clap"))), Optional.of(new ComparisonExpression(ComparisonExpression.Operator.GREATER_THAN, new Identifier("age"), new LongLiteral("17")))));
}
Aggregations