[python] Fix filter on data evolution table not working issue#7211
Open
XiaoHongbo-Hope wants to merge 2 commits intoapache:masterfrom
Open
[python] Fix filter on data evolution table not working issue#7211XiaoHongbo-Hope wants to merge 2 commits intoapache:masterfrom
XiaoHongbo-Hope wants to merge 2 commits intoapache:masterfrom
Conversation
4354588 to
b8e709d
Compare
c694ad0 to
867ca01
Compare
867ca01 to
653f23e
Compare
JingsongLi
reviewed
Feb 11, 2026
| simple_null = self._filter_batch_simple_null(batch) | ||
| if simple_null is not None: | ||
| return simple_null | ||
| if not self.predicate.has_null_check(): |
Contributor
There was a problem hiding this comment.
We can just use Predicate.to_arrow, it is same to other table modes.
JingsongLi
reviewed
Feb 11, 2026
| schema=result.schema, | ||
| ) | ||
| except (TypeError, ValueError, pa.ArrowInvalid) as e: | ||
| logger.debug( |
JingsongLi
reviewed
Feb 11, 2026
| return False | ||
| if self.partition_key_predicate and not self.partition_key_predicate.test(entry.partition): | ||
| return False | ||
| if self.deletion_vectors_enabled and entry.file.level == 0: # do not read level 0 file |
Contributor
There was a problem hiding this comment.
We can refactor this, this if should be in is_primary_key_table.
JingsongLi
reviewed
Feb 11, 2026
| if not self.predicate: | ||
| return True | ||
| if self.predicate_for_stats is None: | ||
| if self.predicate_for_stats is None or self.data_evolution: |
Contributor
There was a problem hiding this comment.
Create a separate if. And we should add comments to this if, explain why there is no filtering done here.
JingsongLi
reviewed
Feb 11, 2026
| super().__init__(table, predicate, read_type, actual_split, row_tracking_enabled) | ||
|
|
||
| def _push_down_predicate(self) -> Optional[Predicate]: | ||
| # Do not push predicate to file readers; |
Contributor
There was a problem hiding this comment.
Detailed comments, why not push predicate.
JingsongLi
reviewed
Feb 11, 2026
| return ConcatBatchReader(suppliers) | ||
| merge_reader = ConcatBatchReader(suppliers) | ||
| if self.predicate is not None: | ||
| # Only apply filter when all predicate columns are in read_type (e.g. projected schema). |
Contributor
There was a problem hiding this comment.
What we are returning here is complete row, right? So this check should be applicable to all table modes? That shouldn't be added here, it should be verified in SplitRead.init.
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/Problem
Filter not working on data evolution read: when a predicate is provided, all rows are returned.
Tests
API and Format
Documentation