Skip to content

Revert Fix exception in join order optimizer when column names overlap - #102121

Closed
rschu1ze wants to merge 1 commit into
masterfrom
revert-100401
Closed

rschu1ze wants to merge 1 commit into
masterfrom
revert-100401

Conversation

@rschu1ze

@rschu1ze rschu1ze commented Apr 8, 2026

Copy link
Copy Markdown
Member

Reverts #100401. Disabling join order optimization hides the problem but doesn't fix it. Adds the original repro as a negative test for the time being.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

@clickhouse-gh

clickhouse-gh Bot commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0839f6a]

Summary: ❌

job_name test_name status info comment
Fast test failure
04054_join_optimizer_overlapping_column_names FAIL cidb
clickhouse-test FAIL cidb
Fast test (arm_darwin) dropped
Build (amd_debug) dropped
Build (amd_asan_ubsan) dropped
Build (amd_tsan) dropped
Build (amd_msan) dropped
Build (amd_binary) dropped
Build (arm_debug) dropped
Build (arm_asan_ubsan) dropped
Build (arm_tsan) dropped

AI Review

Summary

This PR reverts the previous mitigation in optimizeJoin and keeps the reproducer as a negative test, so join-order optimization is re-enabled while issue #89166 remains intentionally unfixed. I found one review issue: the updated test has contradictory wording versus its asserted expected exception, which can mislead future triage.

Findings
  • 💡 Nits
    • [tests/queries/0_stateless/04054_join_optimizer_overlapping_column_names.sql:10-11] The comment says the query "must not throw", but the assertion expects LOGICAL_ERROR (-- { serverError LOGICAL_ERROR }).
    • Suggested fix: reword to reflect current expected behavior (known-bug repro), or remove contradiction.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    • Fix the contradictory test comment in 04054_join_optimizer_overlapping_column_names.sql so expected behavior is unambiguous.

CREATE TABLE t0 ENGINE = Memory AS SELECT 1 c0;

DROP TABLE t_04054;
-- This is a bug and must not throw

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment contradicts the assertion on the same line: the test currently expects LOGICAL_ERROR (-- { serverError LOGICAL_ERROR }), but the text says "must not throw".

Please reword to avoid confusion, e.g. Known bug repro: currently throws LOGICAL_ERROR (or flip the expectation when the bug is fixed).

@alexey-milovidov

Copy link
Copy Markdown
Member

@rschu1ze, let's disable the JOIN order optimization when the column names overlap.

@alexey-milovidov alexey-milovidov added the close in a month if not active This will be closed in case of no information label Jul 26, 2026
@alexey-milovidov alexey-milovidov self-assigned this Jul 26, 2026
@alexey-milovidov alexey-milovidov added the hold Skip for auto-updating. label Jul 26, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

This PR went stale. Also, it does not fix the original logical error.

@alexey-milovidov alexey-milovidov removed close in a month if not active This will be closed in case of no information hold Skip for auto-updating. labels Jul 26, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

Just to clarify, no optimization is better than a wrong optimization.

@alexey-milovidov

Copy link
Copy Markdown
Member

We will harden our CI so that it will be impossible to commit a defective JOIN order optimization.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants