public LogicalSchema resolve(final ExecutionStep<?> step, final LogicalSchema schema) {
    return Optional.ofNullable(HANDLERS.get(step.getClass()))
        .map(h -> h.handle(this, schema, step))
        .orElseThrow(() -> new IllegalStateException("Unhandled step class: " + step.getClass()));
  }
@Test
  public void shouldResolveSchemaForTableSelect() {
    // Given:
    final TableSelect<?> step = new TableSelect<>(
        PROPERTIES,
        tableSource,
        ImmutableList.of(),
        ImmutableList.of(
            add("JUICE", "ORANGE", "APPLE"),
            ref("PLANTAIN", "BANANA"),
            ref("CITRUS", "ORANGE")),
            internalFormats
    );

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