Search in sources :

Example 1 with StreamGroupBy

use of io.confluent.ksql.execution.plan.StreamGroupBy in project ksql by confluentinc.

the class StepSchemaResolverTest method shouldResolveSchemaForStreamGroupBy.

@Test
public void shouldResolveSchemaForStreamGroupBy() {
    // Given:
    final StreamGroupBy<?> step = new StreamGroupBy<>(PROPERTIES, streamSource, formats, ImmutableList.of(new UnqualifiedColumnReferenceExp(Optional.empty(), ORANGE_COL)));
    // When:
    final LogicalSchema result = resolver.resolve(step, SCHEMA);
    // Then:
    assertThat(result, is(LogicalSchema.builder().keyColumn(ORANGE_COL, SqlTypes.INTEGER).valueColumns(SCHEMA.value()).build()));
}
Also used : StreamGroupBy(io.confluent.ksql.execution.plan.StreamGroupBy) LogicalSchema(io.confluent.ksql.schema.ksql.LogicalSchema) UnqualifiedColumnReferenceExp(io.confluent.ksql.execution.expression.tree.UnqualifiedColumnReferenceExp) Test(org.junit.Test)

Aggregations

UnqualifiedColumnReferenceExp (io.confluent.ksql.execution.expression.tree.UnqualifiedColumnReferenceExp)1 StreamGroupBy (io.confluent.ksql.execution.plan.StreamGroupBy)1 LogicalSchema (io.confluent.ksql.schema.ksql.LogicalSchema)1 Test (org.junit.Test)1