use of io.confluent.ksql.execution.plan.TableSelectKey in project ksql by confluentinc.
the class StepSchemaResolverTest method shouldResolveSchemaForTableSelectKey.
@Test
public void shouldResolveSchemaForTableSelectKey() {
// Given:
final UnqualifiedColumnReferenceExp keyExpression1 = new UnqualifiedColumnReferenceExp(ColumnName.of("ORANGE"));
final UnqualifiedColumnReferenceExp keyExpression2 = new UnqualifiedColumnReferenceExp(ColumnName.of("APPLE"));
final TableSelectKey<GenericKey> step = new TableSelectKey<>(PROPERTIES, tableSource, formats, ImmutableList.of(keyExpression1, keyExpression2));
// When:
final LogicalSchema result = resolver.resolve(step, SCHEMA);
// Then:
assertThat(result, is(LogicalSchema.builder().keyColumn(keyExpression1.getColumnName(), SqlTypes.INTEGER).keyColumn(keyExpression2.getColumnName(), SqlTypes.BIGINT).valueColumns(SCHEMA.value()).build()));
}
Aggregations