Skip to content

Commit

Permalink
Refactor HudiPageSourceProvider#createPageSource
Browse files Browse the repository at this point in the history
Moved creation of ParquetReaderOptions to the caller
to ensure that the same options are used consistently
  • Loading branch information
raunaqmorarka committed May 25, 2023
1 parent 677e45c commit 4b17fcf
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,15 @@ public ConnectorPageSource createPageSource(
.collect(Collectors.toList());
TrinoFileSystem fileSystem = fileSystemFactory.create(session);
TrinoInputFile inputFile = fileSystem.newInputFile(Location.of(path), split.getFileSize());
ConnectorPageSource dataPageSource = createPageSource(session, regularColumns, split, inputFile, dataSourceStats, options, timeZone);
ConnectorPageSource dataPageSource = createPageSource(
session,
regularColumns,
split,
inputFile,
dataSourceStats,
options.withBatchColumnReaders(isParquetOptimizedReaderEnabled(session))
.withBatchNestedColumnReaders(isParquetOptimizedNestedReaderEnabled(session)),
timeZone);

return new HudiPageSource(
toPartitionName(split.getPartitionKeys()),
Expand Down Expand Up @@ -238,8 +246,7 @@ && predicateMatches(parquetPredicate, block, dataSource, descriptorsByPath, parq
finalDataSource,
timeZone,
newSimpleAggregatedMemoryContext(),
options.withBatchColumnReaders(isParquetOptimizedReaderEnabled(session))
.withBatchNestedColumnReaders(isParquetOptimizedNestedReaderEnabled(session)),
options,
exception -> handleException(dataSourceId, exception),
Optional.of(parquetPredicate),
columnIndexes.build(),
Expand Down

0 comments on commit 4b17fcf

Please sign in to comment.