Repository navigation
Make 04743_trivial_count_array_join_argument runnable on release branches without unnest - #115505
Conversation
…ches without unnest The test added by ClickHouse#115227 used `unnest`, a case-insensitive alias of `arrayJoin` registered only since 8601d0f (2026-05-16), i.e. after the 25.8 and 26.3 branch points. On those branches the analyzer throws UNKNOWN_FUNCTION before the guard under test is reached, so the backports of ClickHouse#115227 to 25.8 and 26.3 fail on the added test file while the src/Planner fix itself cherry-picks cleanly. All 19 statements of the main block are one client call, so the abort at statement 2 also skipped statements 3-19: every optimize_trivial_count_query = 0 control, the four "optimization is kept" arms and all four EXPLAIN plan assertions. Those backports therefore carried no verification of the fix they exist to port. Drop the two unnest arms from 04743 and relocate the alias coverage into 04241_alias_unnest, which is absent from exactly the branches that lack the alias. This loses nothing at the guard: FunctionNode::resolveAsFunction stores the canonical name, so hasFunctionNode(..., "arrayJoin") sees the two arms identically, and the surviving 20 reference lines are byte-identical with and without them. 04241 gains a MergeTree trivial-count arm with an optimize_trivial_count_query = 0 control. Validated on the backports' own CI build artifacts, both directions on the same binary: 25.8 and 26.3 fail before and are byte-equal to the reference after, with the 17 previously skipped assertions now executing and agreeing; 26.5, 26.6 and 26.7 stay byte-equal. On master both tests pass clickhouse-test, 200/200 over randomized and non-randomized runs. Deleting the guard reddens 7 of 04743's assertions and flips the new 04241 arm from 6 to 3, so neither file is vacuous. This does not turn the already-open backports green: each is built from the parent's frozen merge commit and ClickHouse#115227 carries pr-backports-created, so it is not re-processed.
Internal second-model review (2 findings raised, both refuted on measurement)An independent model reviewed this diff cold. Both substantive findings were investigated and ❌ "Still red in the old-analyzer jobs on 25.8/26.3/26.5, because those branches ignore
💡 A nit asked for the visible Also noted, not addressed: Session id: cron:clickhouse-review-slot-48:20260819-193200 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-4:20260819-172300 |
|
Workflow [PR], commit [c97ca0b] Summary: ✅ AI ReviewSummaryThis PR removes the two Final Verdict✅ No blocking issues found. |
|
cc @yakov-olkhovskiy, could you review this? It is test-only: the test added by #115227 used |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units8 translation units recompiled, 6 s compile time in total, 8 of them have a recent master baseline. |
7881869
`unnest`, a case-insensitive alias of `arrayJoin`, was registered only in 8601d0f (2026-05-16), after the 25.8 branch point. On this branch the analyzer throws `UNKNOWN_FUNCTION` at the second statement of the test's single client call, which also skipped statements 3-19: every `optimize_trivial_count_query = 0` control, the four "optimization is kept" arms and all four `EXPLAIN` plan assertions. So the backport carried no verification of the fix it exists to port. This mirrors the master change c97ca0b (#115505), which dropped the two `unnest` arms and relocated the alias coverage into `04241_alias_unnest` - a test that does not exist on this branch, precisely because the alias does not. Nothing is lost at the guard itself: `FunctionNode::resolveAsFunction` stores the canonical name, so `hasFunctionNode(..., "arrayJoin")` sees the `unnest` arms identically to the `arrayJoin` ones, and the surviving 20 reference lines are byte-identical with and without them. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=115468&sha=77b6ebb9c8604d45e2db4a7111e93258704076fa&name_0=BackportPR Related: #115227 Related: #115505 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Related: #115227
The test added by #115227 used
unnest, a case-insensitive alias ofarrayJoinregistered onlysince
8601d0ff817f(2026-05-16), after the 25.8 and 26.3 branch points. Both backports to thosebranches fail the test with
Code: 46 ... Function with name 'unnest' does not exist, while thesrc/Plannerfix itself cherry-picks cleanly.It is worse than one red arm: all 19 statements of the main block are in a single client call, so
the abort at statement 2 skipped statements 3-19, including all four
EXPLAINplan assertions. Onthose branches the test verified nothing.
This drops the two
unnestarms from 04743 and relocates the alias coverage into04241_alias_unnest, which is absent from exactly the branches that lack the alias. Nothing isweakened:
FunctionNode::resolveAsFunctionstores the canonical name, so at the guard(
hasFunctionNode(aggregates.front(), "arrayJoin")) the two arms were indistinguishable -measured, the surviving 20 reference lines are byte-identical with and without them.
04241gainsa MergeTree trivial-count arm with an
= 0control that reddens on its own fixture when the guardis deleted.
Validated on the backports' own CI binaries (release branch plus the guard), both directions on the
same binary: fails on 25.8/26.3 before, byte-equal to the reference after, with the 17 skipped
assertions now executing and agreeing. 26.5/26.6/26.7 stay byte-equal. On master both tests pass
clickhouse-test, 200/200 randomized and non-randomized, and deleting the guard reddens 7 of04743's assertions.
This does not turn the already-open backports green: each is built from the parent's frozen merge
commit and #115227 is labelled
pr-backports-created, so it is not re-processed. It fixes the filefor any re-created backport and for future PRs touching it.
Noted, not addressed:
no-old-analyzeris unknown totests/clickhouse-testbefore 26.6, whereunknown tags are ignored silently, and is unreachable there.
Per-branch validation matrix
Binaries are the backports' own
build_amd_debugartifacts, each version-asserted before use.UNKNOWN_FUNCTION, 4 of 22 linesUNKNOWN_FUNCTION, 4 of 22 lines[ OK ][ OK ]04241_alias_unnestis absent from exactly the branches that lack the alias, which is why thecoverage can live there safely.
Guard-deletion mutation on master, 04743: reference lines 1-4 go
6/6/5/11 -> 3/3/3/3(thetable's row count, i.e. the wrong result the guard prevents), line 14
0 -> 1and line 151 -> 0(the twoEXPLAINassertions), line 186 -> 0(thefile()arm). Same mutation,04241: the new
optimize_trivial_count_query = 1arm goes6 -> 3while its= 0control stays6.Workflow [PR]
Sync PR [sync-upstream/pr/115505]
Version info
26.8.1.1738(included in26.8and later)