Skip to content

Parquet: Fix variant STRING metrics bounds to use UTF-8 byte order - #17397

Open
vishnuprakaz wants to merge 1 commit into
apache:mainfrom
vishnuprakaz:variant-string-comparator-fix
Open

Parquet: Fix variant STRING metrics bounds to use UTF-8 byte order#17397
vishnuprakaz wants to merge 1 commit into
apache:mainfrom
vishnuprakaz:variant-string-comparator-fix

Conversation

@vishnuprakaz

@vishnuprakaz vishnuprakaz commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Shredded variant STRING metrics bounds are aggregated across row groups with String.compareTo (UTF-16 order), but Parquet stats and the scan-time evaluator (Comparators.charSequences()) use UTF-8 byte order. They disagree for supplementary-plane characters (code point >= U+10000): String.compareTo orders them below BMP characters in U+E000..U+FFFF, while UTF-8 orders them above. When a string column spans row groups mixing the two, the aggregated bounds invert and the evaluator can skip files that contain matching rows. The BINARY branch already uses Comparators.unsignedBytes() and the non-variant path uses Comparators.charSequences(); only variant STRING fell through to naturalOrder(). Same class of bug as #16880.

the bug is present in 1.10.0 & 1.11.0 and backports will follow.

@uros-b

uros-b commented Jul 28, 2026

Copy link
Copy Markdown
Member

Nice fix, thank you @vishnuprakaz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants