Skip to content

Revert "Convert OUTER join to INNER join by null-rejecting join conditions" again - #120119

Merged
alexey-milovidov merged 1 commit into
masterfrom
revert-119305-convert-outer-to-inner-by-join-condition
Sep 15, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
revert-119305-convert-outer-to-inner-by-join-condition

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Reverts #119305 - itself a re-land of #114817 after #119275 - because it broke 05182_join_order_conflict_detector_cast_null_propagation on master.

clickhouse-test randomizes the MergeTree setting auto_statistics_types to a random subset of uniq, uniq_v2, tdigest, countmin, basic. On a subset that leaves out basic - uniq alone is enough - the two non-vacuity arms of the test, cast-nullable cd_a and plain cd_a, stop reassociating, so the plan shape differs from the reference:

 cast-nullable cd_a 	Join
-cast-nullable cd_a 	Read(t1)
 cast-nullable cd_a 	Join
+cast-nullable cd_a 	Read(t1)

Confirmed against the master binaries CI built on either side of the merge, running the test with auto_statistics_types = 'uniq' on all four of its tables: 8f68f32a0846fce6ef73c0b769e6a4140fa2df28 (before) matches the reference, a88f878d7c1350301bc015fc06e7d356ee90e487 (after) produces the diff above.

#120084 has since pinned auto_statistics_types = '' in that test. The pin is kept here - the pinned test passes on the pre-#119305 code, verified with the same binary - so a re-land does not have to re-add it.

Master CI: https://play.clickhouse.com/play?color_modes=%7B%22ppm%22%3A%22none%22%2C%22test_name%22%3A%22categorical%22%7D&tab=Failed%20checks#V0lUSCAodGVzdF9zdGF0dXMgTElLRSAnRiUnIE9SIHRlc3Rfc3RhdHVzIExJS0UgJ0UlJykgQU5EIGNoZWNrX3N0YXR1cyAhPSAnc3VjY2VzcycgQVMgZmFpbCwgSU5URVJWQUwgMjQgSE9VUiBBUyBwZXJpb2QKU0VMRUNUIHVuaXFFeGFjdElmKGNvbW1pdF9zaGEsIGZhaWwpIEFTIGZhaWxlZCwgdW5pcUV4YWN0KGNvbW1pdF9zaGE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2hlY2tfc3RhcnRfdGltZSBERVNDLCBjaGVja19uYW1lLCB0ZXN0X25hbWU7

Related: #119305
Related: #114817
Related: #119275
Related: #120084

Changelog category (leave one):

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

Workflow [PR]
Sync PR [sync-upstream/pr/120119]

Version info

  • Merged into: 26.9.1.1506 (included in 26.9 and later)

…onditions" again

This reverts commit a88f878, reversing
changes made to 8f68f32.

It broke `05182_join_order_conflict_detector_cast_null_propagation` on
`master`. When the test tables carry automatic statistics that do not
include `basic` - `clickhouse-test` randomizes `auto_statistics_types`
to a random subset, and `uniq` alone is enough - the two reassociation
arms of the test stop reassociating, so the plan shape differs from the
reference.

Master CI: https://play.clickhouse.com/play?color_modes=%7B%22ppm%22%3A%22none%22%2C%22test_name%22%3A%22categorical%22%7D&tab=Failed%20checks#V0lUSCAodGVzdF9zdGF0dXMgTElLRSAnRiUnIE9SIHRlc3Rfc3RhdHVzIExJS0UgJ0UlJykgQU5EIGNoZWNrX3N0YXR1cyAhPSAnc3VjY2VzcycgQVMgZmFpbCwgSU5URVJWQUwgMjQgSE9VUiBBUyBwZXJpb2QKU0VMRUNUIHVuaXFFeGFjdElmKGNvbW1pdF9zaGEsIGZhaWwpIEFTIGZhaWxlZCwgdW5pcUV4YWN0KGNvbW1pdF9zaGEpIEFTIHRvdGFsLCByb3VuZCgxIC0gZmFpbGVkIC8gdG90YWwsIDIpIEFTIGtwaSBGUk9NIGNoZWNrcwpXSEVSRSBjaGVja19zdGFydF90aW1lID49IG5vdygpIC0gcGVyaW9kIEFORCBoZWFkX3JlZiA9ICdtYXN0ZXInIEFORCBzdGFydHNXaXRoKGhlYWRfcmVwbywgJ0NsaWNrSG91c2UvJyk7CgpTRUxFQ1Qgcm91bmQoc3VtKCh0ZXN0X3N0YXR1cyBMSUtFICdGJScgT1IgdGVzdF9zdGF0dXMgTElLRSAnRSUnKSBBTkQgY2hlY2tfc3RhdHVzICE9ICdzdWNjZXNzJykgLyBjb3VudCgpICogMTAwMDAwMCwgMikgQVMgcHBtIEZST00gY2hlY2tzCldIRVJFIGNoZWNrX3N0YXJ0X3RpbWUgPj0gbm93KCkgLSBJTlRFUlZBTCAyNCBIT1VSCiAgICBBTkQgKGhlYWRfcmVmID0gJ21hc3RlcicgQU5EIHN0YXJ0c1dpdGgoaGVhZF9yZXBvLCAnQ2xpY2tIb3VzZS8nKSkKICAgIEFORCB0ZXN0X3N0YXR1cyAhPSAnU0tJUFBFRCc7CiAgICAKU0VMRUNUIGNoZWNrX3N0YXJ0X3RpbWUsIGNoZWNrX25hbWUsIHRlc3RfbmFtZSwgcmVwb3J0X3VybApGUk9NIGNoZWNrcwpXSEVSRSAxCiAgICBBTkQgY2hlY2tfc3RhcnRfdGltZSA+PSBub3coKSAtIElOVEVSVkFMIDI0IEhPVVIKICAgIEFORCAoaGVhZF9yZWYgPSAnbWFzdGVyJyBBTkQgc3RhcnRzV2l0aChoZWFkX3JlcG8sICdDbGlja0hvdXNlLycpKQogICAgQU5EIHRlc3Rfc3RhdHVzICE9ICdTS0lQUEVEJwogICAgQU5EICh0ZXN0X3N0YXR1cyBMSUtFICdGJScgT1IgdGVzdF9zdGF0dXMgTElLRSAnRSUnKQogICAgQU5EIGNoZWNrX3N0YXR1cyAhPSAnc3VjY2VzcycKT1JERVIgQlkgY2hlY2tfc3RhcnRfdGltZSBERVNDLCBjaGVja19uYW1lLCB0ZXN0X25hbWU7
@clickhouse-gh

clickhouse-gh Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [9e15a47]


AI Review

Summary

This PR cleanly reverts the null-rejecting join-condition optimization: it removes the planner-only filter infrastructure, the three settings added for that feature, and the associated tests and plan expectations, while preserving the separate auto_statistics_types = '' test stabilization from #120084. I did not find a remaining correctness, safety, or rollback-completeness issue in the current diff.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-joins JOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla... labels Sep 15, 2026
@alexey-milovidov alexey-milovidov self-assigned this Sep 15, 2026
@alexey-milovidov
alexey-milovidov merged commit 120c749 into master Sep 15, 2026
48 of 60 checks passed
@alexey-milovidov
alexey-milovidov deleted the revert-119305-convert-outer-to-inner-by-join-condition branch September 15, 2026 07:10
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-joins JOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla... pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants