Repository navigation
fix(reader): size prefetch by decoded bytes - #99
Merged
Merged
Conversation
The headroom gate that decides whether to prefetch the next row group compared the cache's free memory with parquet's uncompressed_size, the encoded page size. Dictionary- and RLE-encoded columns decode to many times that, so a prefetch could pin ~85x more than the gate allowed for. Estimate each column chunk's decoded Arrow size from its physical type, using unencoded_byte_array_data_bytes (or min/max lengths) for byte arrays, and never below the encoded size. Refs #80
decoded_column_bytes counted INT32/INT64 decimals at 4/8 bytes, but the reader decodes every decimal to Decimal128 (16 bytes) or, above precision 38, Decimal256 (32 bytes), whatever its physical type. Without unencoded_byte_array_data_bytes, string data was sized from the min/max values alone, which are ordered by value rather than length and often truncated. Take the larger of that and the encoded size, and document the result as a best guess that can still under-count. Refs #80
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📊 Benchmark ComparisonCurrent:
Compared Liquid vs DataFusionDefault on the same runner |
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.
The prefetch headroom gate sized row groups by parquet's encoded page size, so dictionary-encoded strings and decimals could pin many times what it allowed for; it now estimates the decoded Arrow size. Closes #80