englefly opened a new pull request, #70106:
URL: https://github.com/apache/doris/pull/70106
### What problem does this PR solve?
Issue Number: N/A
Related PR: #70100
Backport #70100 (commit b5c622238a8d25369278381222b8937cde43b362) to
`branch-4.2`.
Prevent TopN runtime filters from removing matching rows on null-generating
outer join sides when the ordering expression can turn NULL into a non-NULL
value. Apply the shared safety check to hash and nested loop joins and recheck
rewritten hash join keys.
The cherry-pick applied without conflicts. The only branch-specific
adjustment replaces `List.of` with the existing Guava `ImmutableList.of` in the
new unit tests because `branch-4.2` compiles against Java 8 APIs. Production
logic and the regression suite are unchanged from the source PR.
### Release note
Fix incorrect TopN query results for outer joins ordered by expressions that
convert NULL inputs into non-NULL values.
### Check List (For Author)
- Test
- [x] Unit Test: `TopNRuntimeFilterTest` — 13 tests passed, 0
failures/errors/skips, including the three new visitor tests.
- [ ] Regression test: `topn_filter_outer_join_null` is included; not
rerun against a running cluster on this branch.
Validation:
- FE production sources compiled successfully.
- After the Java 8 test adjustment, reran test compilation and the targeted
suite with the existing production classes: `mvn test -pl fe-common,fe-core -am
-Dskip.clean=true -Dmaven.main.skip=true -Dcheckstyle.skip=true
-DfailIfNoTests=false
-Dtest=org.apache.doris.nereids.postprocess.TopNRuntimeFilterTest` (from `fe/`).
- `mvn checkstyle:check -pl fe-core` — 0 violations.
- Behavior changed:
- [x] Yes. Unsafe TopN runtime filters are no longer pushed through
null-generating outer join sides.
- Does this need documentation?
- [x] No.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]