-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Fix](file-scanner) Fix query result is incorrect when non-deterministic func push down. #60186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
morningman
merged 1 commit into
apache:master
from
kaka11chen:fix_non-determin_func_push_down_master
Jan 26, 2026
Merged
[Fix](file-scanner) Fix query result is incorrect when non-deterministic func push down. #60186
morningman
merged 1 commit into
apache:master
from
kaka11chen:fix_non-determin_func_push_down_master
Jan 26, 2026
+2
−2
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
…tic func push down.
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 30960 ms |
TPC-DS: Total hot run time: 172854 ms |
ClickBench: Total hot run time: 26.53 s |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
morningman
approved these changes
Jan 24, 2026
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
zhangstar333
approved these changes
Jan 25, 2026
morningman
approved these changes
Jan 26, 2026
github-actions bot
pushed a commit
that referenced
this pull request
Jan 26, 2026
…tic func push down. (#60186) [Fix] (file-scanner) Fix query result is incorrect when non-deterministic func push down. - After `rand()` is pushed down to the ORC FileScan, it becomes a ScanNode conjunct. Since `rand() < 1` has no column references, `VFileScanner::_process_conjuncts_for_dict_filter` hits `slot_ids.size() == 0 `and returns early. - This early return prevents later predicates from being processed; immediately after, `_process_late_arrival_conjuncts` calls `_discard_conjuncts()` and clears the original predicates. As a result, predicates like `xxx IS NOT NULL` are dropped. - Once dropped, the Parquet/ORC reader only applies the “earlier processed” predicates for filtering, so rows with `xxx = NULL `appear. Therefore, the rand() pushdown triggers the early return in predicate handling, which discards other filters. That’s why NULLs only show up when rand() is pushed down.
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:
Release note
[Fix] (file-scanner) Fix query result is incorrect when non-deterministic func push down.
rand()is pushed down to the ORC FileScan, it becomes a ScanNode conjunct. Sincerand() < 1has no column references,VFileScanner::_process_conjuncts_for_dict_filterhitsslot_ids.size() == 0and returns early._process_late_arrival_conjunctscalls_discard_conjuncts()and clears the original predicates. As a result, predicates likexxx IS NOT NULLare dropped.xxx = NULLappear.Therefore, the rand() pushdown triggers the early return in predicate handling, which discards other filters. That’s why NULLs only show up when rand() is pushed down.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)