[fix](scan) Fix missing predicate filter when Native and JNI readers are mixed in FileScanner#61929
Merged
morningman merged 3 commits intoapache:masterfrom Apr 3, 2026
Merged
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
Author
|
/review |
TPC-H: Total hot run time: 26596 ms |
Contributor
Author
|
run buildall |
TPC-DS: Total hot run time: 169796 ms |
TPC-H: Total hot run time: 26719 ms |
TPC-DS: Total hot run time: 168918 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
morningman
approved these changes
Apr 2, 2026
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
suxiaogang223
approved these changes
Apr 2, 2026
github-actions bot
pushed a commit
that referenced
this pull request
Apr 3, 2026
…are mixed in FileScanner (#61929) ### What problem does this PR solve? Problem Summary: When querying a Paimon table (or other external tables) with a condition that cannot be pushed down (e.g., `LIKE '%*%'`), if a single `FileScanner` instance processes both Native splits (Parquet/ORC) and JNI splits consecutively, the data returned by the JNI reader will skip the fallback filtering at the `Scanner` layer, resulting in dirty data leaking into the final result. Root Cause: 1. When `FileScanner` prepares to read a Native split, it calls `_process_late_arrival_conjuncts()` to assign `_conjuncts` into `_push_down_conjuncts`. 2. However, it mistakenly called `_conjuncts.clear()` at the end of this logic, wiping out the shared fallback `_conjuncts` at the scanner level. 3. When the scanner subsequently processes a JNI split (which does not trigger the push-down logic), `Scanner::_filter_output_block()` finds `_conjuncts` is empty, causing predicates like `LIKE` to be completely bypassed. Solution: Remove the `_conjuncts.clear()` call in `_process_late_arrival_conjuncts()`. This ensures that `_conjuncts` is always retained as the final fallback filter at the `Scanner` level, regardless of how underlying readers execute their own push-down predicates. Added a BE unit test `process_late_arrival_conjuncts_retain` to prevent regression.
suxiaogang223
pushed a commit
to suxiaogang223/doris
that referenced
this pull request
Apr 3, 2026
…are mixed in FileScanner (apache#61929) ### What problem does this PR solve? Problem Summary: When querying a Paimon table (or other external tables) with a condition that cannot be pushed down (e.g., `LIKE '%*%'`), if a single `FileScanner` instance processes both Native splits (Parquet/ORC) and JNI splits consecutively, the data returned by the JNI reader will skip the fallback filtering at the `Scanner` layer, resulting in dirty data leaking into the final result. Root Cause: 1. When `FileScanner` prepares to read a Native split, it calls `_process_late_arrival_conjuncts()` to assign `_conjuncts` into `_push_down_conjuncts`. 2. However, it mistakenly called `_conjuncts.clear()` at the end of this logic, wiping out the shared fallback `_conjuncts` at the scanner level. 3. When the scanner subsequently processes a JNI split (which does not trigger the push-down logic), `Scanner::_filter_output_block()` finds `_conjuncts` is empty, causing predicates like `LIKE` to be completely bypassed. Solution: Remove the `_conjuncts.clear()` call in `_process_late_arrival_conjuncts()`. This ensures that `_conjuncts` is always retained as the final fallback filter at the `Scanner` level, regardless of how underlying readers execute their own push-down predicates. Added a BE unit test `process_late_arrival_conjuncts_retain` to prevent regression.
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.
What problem does this PR solve?
Problem Summary:
When querying a Paimon table (or other external tables) with a condition that cannot be pushed down (e.g.,
LIKE '%*%'), if a singleFileScannerinstance processes both Native splits (Parquet/ORC) and JNI splits consecutively, the data returned by the JNI reader will skip the fallback filtering at theScannerlayer, resulting in dirty data leaking into the final result.Root Cause:
FileScannerprepares to read a Native split, it calls_process_late_arrival_conjuncts()to assign_conjunctsinto_push_down_conjuncts._conjuncts.clear()at the end of this logic, wiping out the shared fallback_conjunctsat the scanner level.Scanner::_filter_output_block()finds_conjunctsis empty, causing predicates likeLIKEto be completely bypassed.Solution:
Remove the
_conjuncts.clear()call in_process_late_arrival_conjuncts(). This ensures that_conjunctsis always retained as the final fallback filter at theScannerlevel, regardless of how underlying readers execute their own push-down predicates.Added a BE unit test
process_late_arrival_conjuncts_retainto prevent regression.Release note
Fix a correctness issue where complex string predicates (like
LIKE) might fail to filter dirty data when querying external tables with mixed native and JNI splits.Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)