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.
Fixes #11545.
PyPaimon can prune files that contain matching rows when a predicate is built after a named projection or
with_read_type(). For example, projecting onlynamefrom[tag, name]movesnameto index 0 in the read schema. The Python planner then uses that index to look up file statistics and compares the predicate againsttag. This can silently drop matching files or raise aTypeErrorwhen the column types differ.This PR records the source field path on projected top-level predicates so the planner uses the correct column statistics during file pruning.
Tests
Added a regression test with two Parquet files. It verifies that
startswith("name", "pro-")andequal("name", "pro-1")each keep exactly one file and returnpro-1. The test covers named projections, output aliases, andwith_read_type(), with both string and integertagcolumns.All 77 tests across the four projection-related test files passed.