Repository navigation
[fix](be) Correct null-aware mark join results for empty correlated subqueries on 4.1 - #70233
Merged
Merged
Conversation
A null-aware mark join uses build index zero for an unmatched probe row. The reusable output slot could retain a NULL flag from an earlier row, causing correlated IN/NOT IN with an empty subquery to return NULL. Clear the NULL flag when emitting the no-match sentinel. For branch-4.1, preserve NULL probe rows for the existing handler and reset their lookup state so they are not skipped. Tests: ASAN BE/FE build with FE checkstyle; two focused BE unit tests; correlated IN/NOT IN SQL regression; clang-format, check-format, and git diff --check. Backport of apache#69762, with the NULL-probe handling prerequisite from apache#63767. (cherry picked from commit aa68b25)
Member
Author
|
run buildall |
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
mrhhsg
marked this pull request as ready for review
November 5, 2026 08:08
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
yiguolei
approved these changes
Nov 10, 2026
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.
Summary
Backport the null-aware mark join correction from #69762 to branch-4.1.
Problem and fix
With an additional join predicate, a no-match sentinel could inherit a NULL flag from an earlier probe row. This could produce NULL instead of the expected FALSE or TRUE for an empty correlated subquery. The sentinel now explicitly clears that flag. The branch-4.1 backport also preserves nullable probe rows so they reach the existing null-key handler.
Testing
BUILD_TYPE=ASAN DISABLE_BE_JAVA_EXTENSIONS=OFF ./build.sh --be --fe -j 48(includes FE checkstyle): passed.BUILD_TYPE=ASAN ./run-be-ut.sh --run --filter='JoinHashTableTest.*' -j 48: 2 tests passed../run-regression-test.sh --conf regression-test/conf/regression-conf.groovy --run -d nereids_syntax_p0 -s mark_join_correlated_empty: 1 suite passed on an isolated ASAN FE/BE cluster.build-support/clang-format.sh,build-support/check-format.sh, andgit diff --check: passed.