Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/611#discussion_r86394551
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/PageReader.java
---
@@ -108,17 +112,31 @@
private final ParquetReaderStats stats;
- PageReader(ColumnReader<?> parentStatus, FileSystem fs, Path path,
ColumnChunkMetaData columnChunkMetaData)
- throws ExecutionSetupException{
+
PageReader(org.apache.drill.exec.store.parquet.columnreaders.ColumnReader<?>
parentStatus, FileSystem fs, Path path, ColumnChunkMetaData columnChunkMetaData)
+ throws ExecutionSetupException {
this.parentColumnReader = parentStatus;
allocatedDictionaryBuffers = new ArrayList<ByteBuf>();
codecFactory = parentColumnReader.parentReader.getCodecFactory();
this.stats = parentColumnReader.parentReader.parquetReaderStats;
long start = columnChunkMetaData.getFirstDataPageOffset();
try {
inputStream = fs.open(path);
- this.dataReader = new ColumnDataReader(inputStream, start,
columnChunkMetaData.getTotalSize());
- loadDictionaryIfExists(parentStatus, columnChunkMetaData,
inputStream);
+ BufferAllocator allocator =
parentColumnReader.parentReader.getOperatorContext().getAllocator();
+ //TODO: make read batch size configurable
+ columnChunkMetaData.getTotalUncompressedSize();
+ boolean useBufferedReader =
parentColumnReader.parentReader.getFragmentContext().getOptions()
+
.getOption(ExecConstants.PARQUET_PAGEREADER_USE_BUFFERED_READ).bool_val;
+ if (useBufferedReader) {
+ this.dataReader = new BufferedDirectBufInputStream(inputStream,
allocator, path.getName(),
+ columnChunkMetaData.getStartingPos(),
columnChunkMetaData.getTotalSize(), 8 * 1024 * 1024,
--- End diff --
Should this be declared as a constant? Is it supposed to match
BufferedDirectBufInputStream.directBufferSize below?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---