Conversation
Signed-off-by: 1fanwang <1fannnw@gmail.com>
Signed-off-by: 1fanwang <1fannnw@gmail.com>
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
Reading the issue's Snappy file with a direct codec returns
value_40001in the key column instead ofkey_40001. The normal codec reads the same file correctly. After this fix, both readers return the expected values for all 51,000 rows.Closes #3150.
What changes are included in this PR?
The page reader copies decompressed data and dictionaries into buffers it owns. A shared codec can then reuse its output buffer for another column without overwriting values still being read. Dictionary copies use the existing row-group cleanup. The path that decompresses directly into a reader-owned buffer is unchanged.
Are these changes tested?
Testing Done
Ran a standalone reader against the reporter's original file on macOS arm64 with JDK 17.0.5. The baseline is 2df8d02.
The baseline produced:
The fixed reader produced:
Built both standalone runtimes with Maven and Thrift 0.24.0. From this PR's checkout, these commands create the jars used below:
Download the fixture attached to the linked issue as
reporter-test.parquet.zip, then extract it:unzip -p reporter-test.parquet.zip test.parquet > test.parquetSave the executed reader below as
ReadDirectCodec.java, then run:Executed reader
Raw result lines
Before, direct reader:
Before, normal reader:
After, direct reader:
After, normal reader:
Also reproduced the failure using a file written by the current writer. The regression covers Snappy and Zstd, both page versions, dictionary and plain encoding, and the normal-reader control. It checks retained dictionary contents and uses tracking allocators to check buffer release.
Are there any user-facing changes?
Direct-codec reads preserve the stored column values. There is no file-format or public API change.