Skip to content

Commit

Permalink
Merge branch 'master' into phoenix-test-run
Browse files Browse the repository at this point in the history
  • Loading branch information
virajjasani authored Dec 18, 2024
2 parents 81f1e5f + 9015414 commit 6d5db5c
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.trino.security.AccessControl;
import io.trino.spi.Page;
import io.trino.spi.PageBuilder;
import io.trino.spi.block.Block;
import io.trino.spi.connector.ColumnHandle;
import io.trino.spi.connector.ColumnMetadata;
import io.trino.spi.connector.ConnectorPageSource;
Expand Down Expand Up @@ -141,18 +140,12 @@ public InformationSchemaPageSource(
.boxed()
.collect(toImmutableMap(i -> columnMetadata.get(i).getName(), Function.identity()));

List<Integer> channels = columns.stream()
int[] channels = columns.stream()
.map(columnHandle -> (InformationSchemaColumnHandle) columnHandle)
.map(columnHandle -> columnNameToChannel.get(columnHandle.columnName()))
.collect(toImmutableList());
.mapToInt(columnHandle -> columnNameToChannel.get(columnHandle.columnName()))
.toArray();

projection = page -> {
Block[] blocks = new Block[channels.size()];
for (int i = 0; i < blocks.length; i++) {
blocks[i] = page.getBlock(channels.get(i));
}
return new Page(page.getPositionCount(), blocks);
};
projection = page -> page.getColumns(channels);
}

@Override
Expand Down

0 comments on commit 6d5db5c

Please sign in to comment.