Skip to content

ci(query): cover cross-type nullable correlated joins - #20409

Open
youngsofun wants to merge 1 commit into
databendlabs:mainfrom
youngsofun:codex/test-cross-type-null-correlation
Open

ci(query): cover cross-type nullable correlated joins#20409
youngsofun wants to merge 1 commit into
databendlabs:mainfrom
youngsofun:codex/test-cross-type-null-correlation

Conversation

@youngsofun

@youngsofun youngsofun commented Aug 28, 2026

Copy link
Copy Markdown
Member

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Motivation

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. EXISTS must return zero rows, while NOT EXISTS must retain all five probe rows. The assertions pass with #20354 and protect both hash join implementations from regressing this coercion path.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Validation performed:

  • cargo build --bin databend-query --bin databend-meta --bin databend-sqllogictests
  • databend-sqllogictests --run 'tests/sqllogictests/suites/query/subquery.test' (273 MySQL and 273 HTTP tests passed)
  • git diff --check

Type of change

AI assistance

  • AI usage: An AI coding agent reproduced the cross-type case, drafted the focused logic-test coverage, and ran the listed validation commands
  • Responsible human: @youngsofun
  • The responsible human has read every line of this diff and can explain each change

This change is Reviewable

@github-actions github-actions Bot added the pr-build this PR changes build/testing/ci steps label Aug 28, 2026
@youngsofun
youngsofun requested a review from sundy-li September 4, 2026 04:34

@sundy-li sundy-li left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-build this PR changes build/testing/ci steps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: correlated EXISTS with cross-type join keys (INT = DECIMAL) wrongly matches NULL probe keys — and returns an unstable number of rows

2 participants