Uh oh!
There was an error while loading. Please reload this page.
[opt](nereids) when we check if there is a target for runtime filter, we should use ctx.probeSlot not ctx.probeExpr - #57425
Merged
Conversation
hello-stephen
commented
Oct 28, 2025
Contributor
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
englefly
commented
Oct 28, 2025
ContributorAuthor
run buildall |
hello-stephen
commented
Oct 28, 2025
Contributor
FE Regression Coverage ReportIncrement line coverage |
englefly
commented
Oct 29, 2025
ContributorAuthor
run feut |
englefly
commented
Oct 29, 2025
ContributorAuthor
run external |
hello-stephen
commented
Oct 29, 2025
Contributor
FE UT Coverage ReportIncrement line coverage |
englefly
marked this pull request as ready for review
October 30, 2025 03:05
englefly
commented
Oct 30, 2025
ContributorAuthor
run external |
starocean999
previously approved these changes
Nov 11, 2025
feiniaofeiafei
approved these changes
Nov 11, 2025
engleflyforce-pushed
the
nlj-rf-slot-ds54
branch
from
November 13, 2025 07:19
67a08bc to
45313c7CompareContributor
PR approved by anyone and no changes requested. |
englefly
commented
Nov 14, 2025
ContributorAuthor
run buildall |
doris-robot
commented
Nov 14, 2025
TPC-H: Total hot run time: 34159 ms |
doris-robot
commented
Nov 14, 2025
TPC-DS: Total hot run time: 188478 ms |
doris-robot
commented
Nov 14, 2025
ClickBench: Total hot run time: 27.26 s |
hello-stephen
commented
Nov 14, 2025
Contributor
FE Regression Coverage ReportIncrement line coverage |
starocean999
approved these changes
Nov 24, 2025
Contributor
PR approved by at least one committer and no changes requested. |
Uh oh!
There was an error while loading. Please reload this page.
nagisa-kunhah pushed a commit
to nagisa-kunhah/doris
that referenced
this pull request
Dec 14, 2025
… we should use ctx.probeSlot not ctx.probeExpr (apache#57425) ### What problem does this PR solve? when we check if there is a target for runtime filter, we should use ctx.probeSlot not ctx.probeExpr
16 tasks
yiguolei pushed a commit
that referenced
this pull request
Jun 5, 2026
…64102) ### What problem does this PR solve? related with: #57425 Runtime filters from a parent inner join could be pushed through an outer join into the null-generating child even when the probe expression was not null-propagating for that child. The problem can be reproduced with this SQL shape: ```sql create table rf_outer_join_nullable_a (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); create table rf_outer_join_nullable_b (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); create table rf_outer_join_nullable_c (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); insert into rf_outer_join_nullable_a values (1); insert into rf_outer_join_nullable_b values (1); insert into rf_outer_join_nullable_c values (0); set disable_join_reorder = true; select coalesce(b.pk, 0) as k, count(*) as cnt from rf_outer_join_nullable_a a left join rf_outer_join_nullable_b b on a.pk = b.pk inner join rf_outer_join_nullable_c c on coalesce(b.pk, 0) = c.pk group by 1 order by 1; ``` The correct result is empty. `a.pk = 1` matches `b.pk = 1` in the left outer join, then the parent inner join evaluates `coalesce(1, 0) = 0`, which is false. The wrong plan generated a runtime filter from the parent inner join, effectively `c.pk -> coalesce(b.pk, 0)`, and pushed it through the lower `LEFT OUTER JOIN` into the right side scan of `b`. If `b.pk = 1` is pre-filtered before the left outer join, the join emits a NULL-extended row for `b`; then `coalesce(NULL, 0) = 0` becomes true and incorrectly returns `(0, 1)`. Therefore the runtime filter `c.pk -> coalesce(b.pk, 0)` must not be planned on the null-generating side of the lower outer join. This PR blocks runtime filter pushdown through an outer join's null-generating child unless the probe expression preserves NULL semantics for slots from that child. Normal pushdown through preserved sides and null-propagating expressions is kept unchanged. The bug became observable after #57425 changed the target lookup for expression runtime filters from `ctx.probeExpr` to `ctx.probeSlot`. Before that change, an expression such as `coalesce(b.pk, 0)` could not resolve the target relation in this path and the unsafe pushdown was not generated. ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [x] Regression test - [x] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> Added regression case with `disable_join_reorder`, `qt_shape`, and empty result verification: `regression-test/suites/correctness_p0/test_runtime_filter_outer_join_nullable_side.groovy` Unit test: `./run-fe-ut.sh --run org.apache.doris.nereids.postprocess.RuntimeFilterTest#testDoNotPushDownNonNullPropagatingRuntimeFilterThroughOuterJoin,org.apache.doris.nereids.postprocess.RuntimeFilterTest#testPushDownNullPropagatingRuntimeFilterThroughOuterJoin` The SQL regression case was not run locally against the available 9333 cluster because that cluster was the unpatched repro cluster. - Behavior changed: - [ ] No. - [x] Yes. Runtime filters are no longer pushed through an outer join into its null-generating child when the probe expression can convert NULL to a non-NULL value. - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
BiteTheDDDDt added a commit
to BiteTheDDDDt/incubator-doris
that referenced
this pull request
Jun 6, 2026
…pache#64102) related with: apache#57425 Runtime filters from a parent inner join could be pushed through an outer join into the null-generating child even when the probe expression was not null-propagating for that child. The problem can be reproduced with this SQL shape: ```sql create table rf_outer_join_nullable_a (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); create table rf_outer_join_nullable_b (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); create table rf_outer_join_nullable_c (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); insert into rf_outer_join_nullable_a values (1); insert into rf_outer_join_nullable_b values (1); insert into rf_outer_join_nullable_c values (0); set disable_join_reorder = true; select coalesce(b.pk, 0) as k, count(*) as cnt from rf_outer_join_nullable_a a left join rf_outer_join_nullable_b b on a.pk = b.pk inner join rf_outer_join_nullable_c c on coalesce(b.pk, 0) = c.pk group by 1 order by 1; ``` The correct result is empty. `a.pk = 1` matches `b.pk = 1` in the left outer join, then the parent inner join evaluates `coalesce(1, 0) = 0`, which is false. The wrong plan generated a runtime filter from the parent inner join, effectively `c.pk -> coalesce(b.pk, 0)`, and pushed it through the lower `LEFT OUTER JOIN` into the right side scan of `b`. If `b.pk = 1` is pre-filtered before the left outer join, the join emits a NULL-extended row for `b`; then `coalesce(NULL, 0) = 0` becomes true and incorrectly returns `(0, 1)`. Therefore the runtime filter `c.pk -> coalesce(b.pk, 0)` must not be planned on the null-generating side of the lower outer join. This PR blocks runtime filter pushdown through an outer join's null-generating child unless the probe expression preserves NULL semantics for slots from that child. Normal pushdown through preserved sides and null-propagating expressions is kept unchanged. The bug became observable after apache#57425 changed the target lookup for expression runtime filters from `ctx.probeExpr` to `ctx.probeSlot`. Before that change, an expression such as `coalesce(b.pk, 0)` could not resolve the target relation in this path and the unsafe pushdown was not generated. None - Test <!-- At least one of them must be included. --> - [x] Regression test - [x] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> Added regression case with `disable_join_reorder`, `qt_shape`, and empty result verification: `regression-test/suites/correctness_p0/test_runtime_filter_outer_join_nullable_side.groovy` Unit test: `./run-fe-ut.sh --run org.apache.doris.nereids.postprocess.RuntimeFilterTest#testDoNotPushDownNonNullPropagatingRuntimeFilterThroughOuterJoin,org.apache.doris.nereids.postprocess.RuntimeFilterTest#testPushDownNullPropagatingRuntimeFilterThroughOuterJoin` The SQL regression case was not run locally against the available 9333 cluster because that cluster was the unpatched repro cluster. - Behavior changed: - [ ] No. - [x] Yes. Runtime filters are no longer pushed through an outer join into its null-generating child when the probe expression can convert NULL to a non-NULL value. - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> (cherry picked from commit 691189a)
BiteTheDDDDt added a commit
to BiteTheDDDDt/incubator-doris
that referenced
this pull request
Jun 7, 2026
…pache#64102) related with: apache#57425 Runtime filters from a parent inner join could be pushed through an outer join into the null-generating child even when the probe expression was not null-propagating for that child. The problem can be reproduced with this SQL shape: ```sql create table rf_outer_join_nullable_a (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); create table rf_outer_join_nullable_b (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); create table rf_outer_join_nullable_c (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); insert into rf_outer_join_nullable_a values (1); insert into rf_outer_join_nullable_b values (1); insert into rf_outer_join_nullable_c values (0); set disable_join_reorder = true; select coalesce(b.pk, 0) as k, count(*) as cnt from rf_outer_join_nullable_a a left join rf_outer_join_nullable_b b on a.pk = b.pk inner join rf_outer_join_nullable_c c on coalesce(b.pk, 0) = c.pk group by 1 order by 1; ``` The correct result is empty. `a.pk = 1` matches `b.pk = 1` in the left outer join, then the parent inner join evaluates `coalesce(1, 0) = 0`, which is false. The wrong plan generated a runtime filter from the parent inner join, effectively `c.pk -> coalesce(b.pk, 0)`, and pushed it through the lower `LEFT OUTER JOIN` into the right side scan of `b`. If `b.pk = 1` is pre-filtered before the left outer join, the join emits a NULL-extended row for `b`; then `coalesce(NULL, 0) = 0` becomes true and incorrectly returns `(0, 1)`. Therefore the runtime filter `c.pk -> coalesce(b.pk, 0)` must not be planned on the null-generating side of the lower outer join. This PR blocks runtime filter pushdown through an outer join's null-generating child unless the probe expression preserves NULL semantics for slots from that child. Normal pushdown through preserved sides and null-propagating expressions is kept unchanged. The bug became observable after apache#57425 changed the target lookup for expression runtime filters from `ctx.probeExpr` to `ctx.probeSlot`. Before that change, an expression such as `coalesce(b.pk, 0)` could not resolve the target relation in this path and the unsafe pushdown was not generated. None - Test <!-- At least one of them must be included. --> - [x] Regression test - [x] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> Added regression case with `disable_join_reorder`, `qt_shape`, and empty result verification: `regression-test/suites/correctness_p0/test_runtime_filter_outer_join_nullable_side.groovy` Unit test: `./run-fe-ut.sh --run org.apache.doris.nereids.postprocess.RuntimeFilterTest#testDoNotPushDownNonNullPropagatingRuntimeFilterThroughOuterJoin,org.apache.doris.nereids.postprocess.RuntimeFilterTest#testPushDownNullPropagatingRuntimeFilterThroughOuterJoin` The SQL regression case was not run locally against the available 9333 cluster because that cluster was the unpatched repro cluster. - Behavior changed: - [ ] No. - [x] Yes. Runtime filters are no longer pushed through an outer join into its null-generating child when the probe expression can convert NULL to a non-NULL value. - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> (cherry picked from commit 691189a)
BiteTheDDDDt added a commit
to BiteTheDDDDt/incubator-doris
that referenced
this pull request
Jun 7, 2026
…pache#64102) related with: apache#57425 Runtime filters from a parent inner join could be pushed through an outer join into the null-generating child even when the probe expression was not null-propagating for that child. The problem can be reproduced with this SQL shape: ```sql create table rf_outer_join_nullable_a (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); create table rf_outer_join_nullable_b (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); create table rf_outer_join_nullable_c (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); insert into rf_outer_join_nullable_a values (1); insert into rf_outer_join_nullable_b values (1); insert into rf_outer_join_nullable_c values (0); set disable_join_reorder = true; select coalesce(b.pk, 0) as k, count(*) as cnt from rf_outer_join_nullable_a a left join rf_outer_join_nullable_b b on a.pk = b.pk inner join rf_outer_join_nullable_c c on coalesce(b.pk, 0) = c.pk group by 1 order by 1; ``` The correct result is empty. `a.pk = 1` matches `b.pk = 1` in the left outer join, then the parent inner join evaluates `coalesce(1, 0) = 0`, which is false. The wrong plan generated a runtime filter from the parent inner join, effectively `c.pk -> coalesce(b.pk, 0)`, and pushed it through the lower `LEFT OUTER JOIN` into the right side scan of `b`. If `b.pk = 1` is pre-filtered before the left outer join, the join emits a NULL-extended row for `b`; then `coalesce(NULL, 0) = 0` becomes true and incorrectly returns `(0, 1)`. Therefore the runtime filter `c.pk -> coalesce(b.pk, 0)` must not be planned on the null-generating side of the lower outer join. This PR blocks runtime filter pushdown through an outer join's null-generating child unless the probe expression preserves NULL semantics for slots from that child. Normal pushdown through preserved sides and null-propagating expressions is kept unchanged. The bug became observable after apache#57425 changed the target lookup for expression runtime filters from `ctx.probeExpr` to `ctx.probeSlot`. Before that change, an expression such as `coalesce(b.pk, 0)` could not resolve the target relation in this path and the unsafe pushdown was not generated. None - Test <!-- At least one of them must be included. --> - [x] Regression test - [x] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> Added regression case with `disable_join_reorder`, `qt_shape`, and empty result verification: `regression-test/suites/correctness_p0/test_runtime_filter_outer_join_nullable_side.groovy` Unit test: `./run-fe-ut.sh --run org.apache.doris.nereids.postprocess.RuntimeFilterTest#testDoNotPushDownNonNullPropagatingRuntimeFilterThroughOuterJoin,org.apache.doris.nereids.postprocess.RuntimeFilterTest#testPushDownNullPropagatingRuntimeFilterThroughOuterJoin` The SQL regression case was not run locally against the available 9333 cluster because that cluster was the unpatched repro cluster. - Behavior changed: - [ ] No. - [x] Yes. Runtime filters are no longer pushed through an outer join into its null-generating child when the probe expression can convert NULL to a non-NULL value. - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> (cherry picked from commit 691189a)
github-actionsBot
pushed a commit
that referenced
this pull request
Jun 9, 2026
… we should use ctx.probeSlot not ctx.probeExpr (#57425) ### What problem does this PR solve? when we check if there is a target for runtime filter, we should use ctx.probeSlot not ctx.probeExpr
morningman pushed a commit
to BiteTheDDDDt/incubator-doris
that referenced
this pull request
Jun 24, 2026
…pache#64102) related with: apache#57425 Runtime filters from a parent inner join could be pushed through an outer join into the null-generating child even when the probe expression was not null-propagating for that child. The problem can be reproduced with this SQL shape: ```sql create table rf_outer_join_nullable_a (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); create table rf_outer_join_nullable_b (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); create table rf_outer_join_nullable_c (pk int) duplicate key(pk) distributed by hash(pk) buckets 1 properties("replication_num" = "1"); insert into rf_outer_join_nullable_a values (1); insert into rf_outer_join_nullable_b values (1); insert into rf_outer_join_nullable_c values (0); set disable_join_reorder = true; select coalesce(b.pk, 0) as k, count(*) as cnt from rf_outer_join_nullable_a a left join rf_outer_join_nullable_b b on a.pk = b.pk inner join rf_outer_join_nullable_c c on coalesce(b.pk, 0) = c.pk group by 1 order by 1; ``` The correct result is empty. `a.pk = 1` matches `b.pk = 1` in the left outer join, then the parent inner join evaluates `coalesce(1, 0) = 0`, which is false. The wrong plan generated a runtime filter from the parent inner join, effectively `c.pk -> coalesce(b.pk, 0)`, and pushed it through the lower `LEFT OUTER JOIN` into the right side scan of `b`. If `b.pk = 1` is pre-filtered before the left outer join, the join emits a NULL-extended row for `b`; then `coalesce(NULL, 0) = 0` becomes true and incorrectly returns `(0, 1)`. Therefore the runtime filter `c.pk -> coalesce(b.pk, 0)` must not be planned on the null-generating side of the lower outer join. This PR blocks runtime filter pushdown through an outer join's null-generating child unless the probe expression preserves NULL semantics for slots from that child. Normal pushdown through preserved sides and null-propagating expressions is kept unchanged. The bug became observable after apache#57425 changed the target lookup for expression runtime filters from `ctx.probeExpr` to `ctx.probeSlot`. Before that change, an expression such as `coalesce(b.pk, 0)` could not resolve the target relation in this path and the unsafe pushdown was not generated. None - Test <!-- At least one of them must be included. --> - [x] Regression test - [x] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> Added regression case with `disable_join_reorder`, `qt_shape`, and empty result verification: `regression-test/suites/correctness_p0/test_runtime_filter_outer_join_nullable_side.groovy` Unit test: `./run-fe-ut.sh --run org.apache.doris.nereids.postprocess.RuntimeFilterTest#testDoNotPushDownNonNullPropagatingRuntimeFilterThroughOuterJoin,org.apache.doris.nereids.postprocess.RuntimeFilterTest#testPushDownNullPropagatingRuntimeFilterThroughOuterJoin` The SQL regression case was not run locally against the available 9333 cluster because that cluster was the unpatched repro cluster. - Behavior changed: - [ ] No. - [x] Yes. Runtime filters are no longer pushed through an outer join into its null-generating child when the probe expression can convert NULL to a non-NULL value. - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> (cherry picked from commit 691189a)
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 freeto 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?
when we check if there is a target for runtime filter, we should use ctx.probeSlot not ctx.probeExpr
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)