Repository navigation
Conversation
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.
Closes #11627
PyPaimon can return incorrect rows when a
TIMESTAMP(9)comparison is combined with a predicate that requires row-level filtering. For example, if two rows matchname LIKE 'k%p'and their timestamps differ by one nanosecond, filtering for the first timestamp returns both rows, while filtering for the second returns none. Polars converts both values to the same microsecond-precision Pythondatetimeduring row iteration.This PR compares the stored integer timestamp values with literals expressed in the column’s time unit. This preserves nanosecond precision and keeps range comparisons exact when a literal falls between two representable column values. The reader reuses the prepared predicate across batches and returns the selected rows from the original Arrow batch.
Tests
Added a Parquet regression test for the two rows. With the compound filter, both
to_arrow()andto_iterator()now return[1]for the first timestamp and[2]for the second. The test also verifies the stored nanosecond value when the timestamp column is projected.Additional cases cover equality, range and membership predicates,
NULLvalues, mixed timestamp units, and timezone-aware literals.pypaimon_rustwas unavailable.