hcrosse commented on code in PR #1743:
URL: https://github.com/apache/arrow-go/pull/1743#discussion_r4810806978


##########
parquet/file/file_reader.go:
##########
@@ -327,12 +336,18 @@ func (f *Reader) NumRowGroups() int {
 func (f *Reader) RowGroup(i int) *RowGroupReader {
        rg := f.metadata.RowGroups[i]
 
+       f.cacheMu.Lock()
+       cache := f.chunkCache
+       f.cacheMu.Unlock()
+
        return &RowGroupReader{
                fileMetadata:    f.metadata,
                rgMetadata:      metadata.NewRowGroupMetaData(rg, 
f.metadata.Schema, f.WriterVersion(), f.fileDecryptor),
+               rgIdx:           i,
                props:           f.props,
                r:               f.r,
                fileDecryptor:   f.fileDecryptor,
+               chunkCache:      cache,

Review Comment:
   I switched `Reader` to a single persistent cache handle shared with every 
`RowGroupReader`, so plans registered or replaced after `RowGroup` creation 
take effect immediately, and added tests covering both cases.



##########
parquet/pqarrow/file_reader.go:
##########
@@ -616,17 +616,24 @@ func (fr *FileReader) getRecordReader(ctx 
context.Context, colIndices, rowGroups
                }
        }
 
-       // TODO(mtopol): add optimizations to pre-buffer data from the file
+       if fr.Props.PreBuffer {
+               if err := fr.rdr.PreBuffer(rowGroups, colIndices, 
fr.Props.CacheOptions); err != nil {

Review Comment:
   I updated the record reader to step spanning batches along row-group 
boundaries and concatenate per-column chunks when `PreBuffer` is enabled across 
multiple row groups, so every column consumes and evicts the active row group 
before the next one is fetched, and added tests for default (`BatchSize: 0`), 
oversized, and seek-offset spanning batches.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to