Search in sources :

Example 1 with SuppressNode

use of io.confluent.ksql.planner.plan.SuppressNode in project ksql by confluentinc.

the class LogicalPlannerTest method testSuppressLogicalPlan.

@Test
public void testSuppressLogicalPlan() {
    final String simpleQuery = "SELECT col1,COUNT(*) as COUNT FROM test2 WINDOW TUMBLING (SIZE 2 MILLISECONDS, GRACE PERIOD 1 MILLISECONDS) GROUP BY col1 EMIT FINAL;";
    final PlanNode logicalPlan = buildLogicalPlan(simpleQuery);
    assertThat(logicalPlan.getSources().get(0), instanceOf(SuppressNode.class));
    assertThat(logicalPlan.getSources().get(0).getSources().get(0), instanceOf(AggregateNode.class));
    assertThat(logicalPlan.getSources().get(0).getSources().get(0).getSources().get(0), instanceOf(DataSourceNode.class));
    assertThat(logicalPlan.getSchema().value().size(), equalTo(2));
    Assert.assertNotNull(((SuppressNode) logicalPlan.getSources().get(0)).getRefinementInfo());
}
Also used : DataSourceNode(io.confluent.ksql.planner.plan.DataSourceNode) PlanNode(io.confluent.ksql.planner.plan.PlanNode) AggregateNode(io.confluent.ksql.planner.plan.AggregateNode) SuppressNode(io.confluent.ksql.planner.plan.SuppressNode) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Aggregations

AggregateNode (io.confluent.ksql.planner.plan.AggregateNode)1 DataSourceNode (io.confluent.ksql.planner.plan.DataSourceNode)1 PlanNode (io.confluent.ksql.planner.plan.PlanNode)1 SuppressNode (io.confluent.ksql.planner.plan.SuppressNode)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 Test (org.junit.Test)1