use of io.confluent.ksql.execution.plan.StreamSelect in project ksql by confluentinc.
the class StepSchemaResolverTest method shouldResolveSchemaForStreamSelectWithoutColumnNames.
@Test
public void shouldResolveSchemaForStreamSelectWithoutColumnNames() {
// Given:
final StreamSelect<?> step = new StreamSelect<>(PROPERTIES, streamSource, ImmutableList.of(ColumnName.of("NEW_KEY")), ImmutableList.of(add("JUICE", "ORANGE", "APPLE"), ref("PLANTAIN", "BANANA"), ref("CITRUS", "ORANGE")));
// When:
final LogicalSchema result = resolver.resolve(step, SCHEMA);
// Then:
assertThat(result, is(LogicalSchema.builder().keyColumn(ColumnName.of("NEW_KEY"), SqlTypes.INTEGER).valueColumn(ColumnName.of("JUICE"), SqlTypes.BIGINT).valueColumn(ColumnName.of("PLANTAIN"), SqlTypes.STRING).valueColumn(ColumnName.of("CITRUS"), SqlTypes.INTEGER).build()));
}
use of io.confluent.ksql.execution.plan.StreamSelect in project ksql by confluentinc.
the class StepSchemaResolverTest method shouldResolveSchemaForStreamSelect.
@Test
public void shouldResolveSchemaForStreamSelect() {
// Given:
final StreamSelect<?> step = new StreamSelect<>(PROPERTIES, streamSource, ImmutableList.of(), ImmutableList.of(add("JUICE", "ORANGE", "APPLE"), ref("PLANTAIN", "BANANA"), ref("CITRUS", "ORANGE")));
// When:
final LogicalSchema result = resolver.resolve(step, SCHEMA);
// Then:
assertThat(result, is(LogicalSchema.builder().keyColumn(ColumnName.of("K0"), SqlTypes.INTEGER).valueColumn(ColumnName.of("JUICE"), SqlTypes.BIGINT).valueColumn(ColumnName.of("PLANTAIN"), SqlTypes.STRING).valueColumn(ColumnName.of("CITRUS"), SqlTypes.INTEGER).build()));
}
Aggregations