ci(query): cover cross-type nullable correlated joins - #20409
Open
youngsofun wants to merge 1 commit into
Open
Conversation
sundy-li
approved these changes
Sep 6, 2026
sundy-li
left a comment
Member
There was a problem hiding this comment.
Verified: applied the diff on main, ran databend-sqllogictests against subquery.test with both mysql and http handlers (273/273 passed each). Test-only change, additive, follows existing file conventions. LGTM.
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.
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
EXISTSwith cross-type join keys (INT = DECIMAL) wrongly matches NULL probe keys — and returns an unstable number of rows #20364BIGINT = DECIMAL(20, 0)join-key coercionEXISTSandNOT EXISTSunder the experimental and legacy hash joinsMotivation
PR #20354 fixed correlated hash joins that dropped nullable probe-key validity and consequently treated NULL fixed-width keys as their physical default values. Its regression tests cover same-type DECIMAL, BOOLEAN, and TIMESTAMP keys, but #20364 specifically reported a cross-type numeric comparison where casting a nullable BIGINT probe key to DECIMAL exposed the same defect.
This test-only follow-up preserves the issue's exact cardinality-sensitive input: three NULL rows plus two non-matching BIGINT values on the probe side and a single DECIMAL zero on the build side.
EXISTSmust return zero rows, whileNOT EXISTSmust retain all five probe rows. The assertions pass with #20354 and protect both hash join implementations from regressing this coercion path.Tests
Validation performed:
cargo build --bin databend-query --bin databend-meta --bin databend-sqllogictestsdatabend-sqllogictests --run 'tests/sqllogictests/suites/query/subquery.test'(273 MySQL and 273 HTTP tests passed)git diff --checkType of change
EXISTSwith cross-type join keys (INT = DECIMAL) wrongly matches NULL probe keys — and returns an unstable number of rows #20364AI assistance
This change is