Repository navigation
[python] Keep files with NaN float stats in stats-based pruning - #10877
Open
plusplusjiajia wants to merge 1 commit into
Open
plusplusjiajia wants to merge 1 commit into
plusplusjiajia wants to merge 1 commit into
Conversation
Stats-based file pruning compared NaN min, max or literal values with IEEE semantics, where every comparison with NaN is false, so for example a file whose max is NaN was skipped for greater_than. Java orders NaN above every other value (CompareUtils) and keeps such files, and its stats collectors can write NaN bounds, for example for Avro. Stats with a NaN min, max or literal now keep the file. PyPaimon's row-level comparisons stay IEEE, so the stats do not adopt Java's ordering yet; full parity for NaN and signed zero is left for a separate change.
plusplusjiajia
marked this pull request as ready for review
October 29, 2026 13:42
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.
Purpose
Stats-based file pruning compared NaN min, max or literal values with IEEE semantics, where every comparison with NaN is false. For example, a file whose max is NaN was skipped for
greater_than, so rows in that file were missing from the result. Java orders NaN above every other value (CompareUtils) and keeps such files, and Java's stats collectors can write NaN bounds, for example for Avro.Stats with a NaN min, max or literal now keep the file. This only makes pruning more conservative: such files are read and filtered row by row.
PyPaimon's row-level comparisons stay IEEE, so the stats do not adopt Java's ordering yet. Full parity for NaN and signed zero is left for a separate change.
Tests
predicates_test.py#test_by_simple_stats_with_nan: FLOAT and DOUBLE stats with a NaN min, max or literal keep the file for every comparison,in,not_in,betweenandnot_between, and finite stats keep their results.predicates_test.py#test_append_read_with_nan_stats: an Avro append table whose file has a NaN max, as Java's stats collector writes it, returns the matching row forgreater_than.