Search in sources :

Example 1 with StreamFlatMap

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

the class StepSchemaResolverTest method shouldResolveSchemaForStreamFlatMap.

@Test
public void shouldResolveSchemaForStreamFlatMap() {
    // Given:
    givenTableFunction("EXPLODE", SqlTypes.DOUBLE);
    final StreamFlatMap<?> step = new StreamFlatMap<>(PROPERTIES, streamSource, ImmutableList.of(functionCall("EXPLODE", "BANANA")));
    // When:
    final LogicalSchema result = resolver.resolve(step, SCHEMA);
    // Then:
    assertThat(result, is(LogicalSchema.builder().keyColumn(ColumnName.of("K0"), SqlTypes.INTEGER).valueColumn(ColumnName.of("ORANGE"), SqlTypes.INTEGER).valueColumn(ColumnName.of("APPLE"), SqlTypes.BIGINT).valueColumn(ColumnName.of("BANANA"), SqlTypes.STRING).valueColumn(ColumnNames.synthesisedSchemaColumn(0), SqlTypes.DOUBLE).build()));
}
Also used : StreamFlatMap(io.confluent.ksql.execution.plan.StreamFlatMap) LogicalSchema(io.confluent.ksql.schema.ksql.LogicalSchema) Test(org.junit.Test)

Aggregations

StreamFlatMap (io.confluent.ksql.execution.plan.StreamFlatMap)1 LogicalSchema (io.confluent.ksql.schema.ksql.LogicalSchema)1 Test (org.junit.Test)1