Fix truncated string statistics handling#79
Merged
WenyXu merged 1 commit intodatafusion-contrib:mainfrom Mar 3, 2026
Merged
Conversation
Collaborator
|
Hi @Flyangz , The CI is failed |
23a6358 to
7ee8a1b
Compare
7ee8a1b to
51b97ea
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes predicate pushdown correctness when ORC string statistics are truncated by properly interpreting minimum/maximum vs lower_bound/upper_bound, and introduces explicit “exactness” indicators to avoid incorrect row-group pruning.
Changes:
- Update string statistics decoding to prefer exact
minimum/maximumand otherwise uselower_bound/upper_bound, tracking whether bounds are exact. - Extend row-group string predicate evaluation to incorporate exact-vs-bound semantics.
- Update CLI/stat formatting outputs and golden expected output to include
IsExactMin/IsExactMax.
Reviewed changes
Copilot reviewed 2 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/bin/expected/stats.out | Updates golden output to include IsExactMin/IsExactMax lines for string stats. |
| src/statistics.rs | Decodes string stats using exact min/max when available, otherwise uses lower/upper bounds and records exactness flags; returns no type stats when number_of_values == 0. |
| src/row_group_filter.rs | Uses the new string bound/exactness fields in predicate evaluation and adds unit tests for string comparison logic. |
| src/bin/orc/stats.rs | Prints exactness flags for string statistics in the orc stats CLI output. |
| src/bin/orc/common.rs | Includes exactness flags in formatted stats output for CLI/common formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WenyXu
approved these changes
Mar 3, 2026
Collaborator
|
@Flyangz Thanks! |
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.
Problem
When string statistics are truncated (long strings), the reader ignored
lower_bound/upper_boundand defaulted to empty strings. This caused valid row groups to be incorrectly skipped during predicate pushdown.Fix
minimum/maximumfirst; fallback tolower_bound/upper_boundif missing.Nonefor statistics immediately ifnumber_of_valuesis 0.These changes match Java writer logic in https://github.com/apache/orc/blob/495c5b364aa7763bc36d08c2ca4c41e5db968d0b/java/core/src/java/org/apache/orc/impl/ColumnStatisticsImpl.java#L797-L816
Test
Added unit tests.