feat(parquet): add byte buffer when disable buffered stream#302
Merged
zeroshade merged 5 commits intoapache:mainfrom Mar 7, 2025
Merged
feat(parquet): add byte buffer when disable buffered stream#302zeroshade merged 5 commits intoapache:mainfrom
zeroshade merged 5 commits intoapache:mainfrom
Conversation
zeroshade
reviewed
Mar 4, 2025
parquet/file/page_reader.go
Outdated
Comment on lines
+534
to
+536
| rd := utils.NewBufferedReader( | ||
| io.NewSectionReader(p.r.Outer(), p.dictOffset-p.baseOffset, p.dataOffset-p.baseOffset), | ||
| p.r.BufferSize()) | ||
| int(parquet.DefaultBufSize)) |
Member
There was a problem hiding this comment.
This would remove our respecting of the BufferSize property in the reader properties, we shouldn't be removing the BufferSize() method
Contributor
Author
There was a problem hiding this comment.
So how about change it to:
readBufSize := min(p.dataOffset-p.baseOffset, p.r.BufferSize())
rd := utils.NewBufferedReader(
io.NewSectionReader(p.r.Outer(), p.dictOffset-p.baseOffset, p.dataOffset-p.baseOffset),
readBufSize)
Contributor
Author
|
Can I manually rerun the CI? |
Member
|
Done! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
When we create a reader with
BufferedStreamEnabled = false, we have to first create adataslice.arrow-go/parquet/reader_properties.go
Lines 76 to 91 in efecae3
And we will create another slice with same size in the
NewBufferedReaderagain, which is redundant.arrow-go/internal/utils/buf_reader.go
Lines 45 to 51 in efecae3
What changes are included in this PR?
byteReader, which is a wrapper ofbytes.NewReaderand implementBufferedReaderinterface.BufferSize()method fromBufferedReaderinterfaceAre these changes tested?
BufferedReadercreated frombytes.NewReaderin tests are all replaced by new functionNewByteReader.Are there any user-facing changes?
No.