use of io.confluent.ksql.parser.tree.QueryContainer in project ksql by confluentinc.
the class AstBuilderTest method shouldSupportExplicitEmitFinalForInsertInto.
@Test
public void shouldSupportExplicitEmitFinalForInsertInto() {
// Given:
final SingleStatementContext stmt = givenQuery("INSERT INTO TEST1 SELECT * FROM TEST2 EMIT FINAL;");
// When:
final Query result = ((QueryContainer) builder.buildStatement(stmt)).getQuery();
// Then:
assertThat("Should be push", result.isPullQuery(), is(false));
assertThat(result.getRefinement().get().getOutputRefinement(), is(OutputRefinement.FINAL));
}
use of io.confluent.ksql.parser.tree.QueryContainer in project ksql by confluentinc.
the class AstBuilderTest method shouldSupportExplicitEmitFinalForCsas.
@Test
public void shouldSupportExplicitEmitFinalForCsas() {
// Given:
final SingleStatementContext stmt = givenQuery("CREATE STREAM X AS SELECT * FROM TEST1 EMIT FINAL;");
// When:
final Query result = ((QueryContainer) builder.buildStatement(stmt)).getQuery();
// Then:
assertThat("Should be push", result.isPullQuery(), is(false));
assertThat(result.getRefinement().get().getOutputRefinement(), is(OutputRefinement.FINAL));
}
use of io.confluent.ksql.parser.tree.QueryContainer in project ksql by confluentinc.
the class AstBuilderTest method shouldDefaultToEmitChangesForCtas.
@Test
public void shouldDefaultToEmitChangesForCtas() {
// Given:
final SingleStatementContext stmt = givenQuery("CREATE TABLE X AS SELECT COUNT(1) FROM TEST1 GROUP BY ROWKEY;");
// When:
final Query result = ((QueryContainer) builder.buildStatement(stmt)).getQuery();
// Then:
assertThat("Should be push", result.isPullQuery(), is(false));
assertThat(result.getRefinement().get().getOutputRefinement(), is(OutputRefinement.CHANGES));
}
use of io.confluent.ksql.parser.tree.QueryContainer in project ksql by confluentinc.
the class AstBuilderTest method shouldDefaultToEmitChangesForInsertInto.
@Test
public void shouldDefaultToEmitChangesForInsertInto() {
// Given:
final SingleStatementContext stmt = givenQuery("INSERT INTO TEST1 SELECT * FROM TEST2;");
// When:
final Query result = ((QueryContainer) builder.buildStatement(stmt)).getQuery();
// Then:
assertThat("Should be push", result.isPullQuery(), is(false));
assertThat(result.getRefinement().get().getOutputRefinement(), is(OutputRefinement.CHANGES));
}
use of io.confluent.ksql.parser.tree.QueryContainer in project ksql by confluentinc.
the class AstBuilderTest method shouldSupportExplicitEmitFinalForCtas.
@Test
public void shouldSupportExplicitEmitFinalForCtas() {
// Given:
final SingleStatementContext stmt = givenQuery("CREATE TABLE X AS SELECT COUNT(1) FROM TEST1 GROUP BY ROWKEY EMIT FINAL;");
// When:
final Query result = ((QueryContainer) builder.buildStatement(stmt)).getQuery();
// Then:
assertThat("Should be push", result.isPullQuery(), is(false));
assertThat(result.getRefinement().get().getOutputRefinement(), is(OutputRefinement.FINAL));
}
Aggregations