Skip to content

Fix join with StorageJoin with USING clause#94000

Merged
novikd merged 5 commits intomasterfrom
fix-right-storage-join
Jan 19, 2026
Merged

Fix join with StorageJoin with USING clause#94000
novikd merged 5 commits intomasterfrom
fix-right-storage-join

Conversation

@novikd
Copy link
Copy Markdown
Member

@novikd novikd commented Jan 12, 2026

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC) or LOGICAL_ERROR

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fix type conversion to super type during the join operation of the storage Join with USING clause. Fixes #91672. Fixes #78572.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Close #94406

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Jan 12, 2026

Workflow [PR], commit [c5406fc]

Summary:

job_name test_name status info comment
Stateless tests (amd_ubsan, sequential) failure
03032_dynamically_resize_filesystem_cache_2 FAIL cidb, issue ISSUE CREATED
AST fuzzer (amd_debug) failure
Logical error: 'col.name == prewhere_info->prewhere_column_name' (STID: 2508-4688) FAIL cidb, issue ISSUE EXISTS

@clickhouse-gh clickhouse-gh bot added pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! labels Jan 12, 2026
@novikd novikd added this pull request to the merge queue Jan 19, 2026
Merged via the queue into master with commit 7320835 Jan 19, 2026
129 of 132 checks passed
@novikd novikd deleted the fix-right-storage-join branch January 19, 2026 12:36
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Jan 19, 2026
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jan 19, 2026
robot-ch-test-poll added a commit that referenced this pull request Jan 19, 2026
Cherry pick #94000 to 25.10: Fix join with StorageJoin with USING clause
robot-ch-test-poll added a commit that referenced this pull request Jan 19, 2026
Cherry pick #94000 to 25.11: Fix join with StorageJoin with USING clause
robot-ch-test-poll added a commit that referenced this pull request Jan 19, 2026
Cherry pick #94000 to 25.12: Fix join with StorageJoin with USING clause
clickhouse-gh bot added a commit that referenced this pull request Jan 19, 2026
Backport #94000 to 25.12: Fix join with StorageJoin with USING clause
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jan 20, 2026
novikd added a commit that referenced this pull request Jan 21, 2026
Backport #94000 to 25.11: Fix join with StorageJoin with USING clause
clickhouse-gh bot added a commit that referenced this pull request Jan 22, 2026
Backport #94000 to 25.10: Fix join with StorageJoin with USING clause
alexey-milovidov added a commit that referenced this pull request Feb 8, 2026
…n path

The legacy join planning path (`query_plan_use_new_logical_join_step` = 0)
did not add type conversion for right-side USING columns after `FilledJoinStep`.
The pre-join cast on `right_plan` was ineffective because filled joins
(`StorageJoin`) don't use `right_plan` data — it comes directly from storage.

This caused downstream steps (e.g., QUALIFY filter) to see the original
storage type (`UInt32`) instead of the expected USING super type
(`Nullable(UInt32)`), triggering:
  Logical error: 'Unexpected return type from equals.
  Expected Nullable(UInt8). Got UInt8.'

The new logical join step path already handled this (PR #94000) by adding
"Right Type Conversion Actions". Apply the same conversion in the legacy path.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=96359&sha=2663a0412e2c5796633875276ad818515e5f5e2d&name_0=PR&name_1=Stress%20test%20%28amd_debug%29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

5 participants