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()));
}
Aggregations