Skip to content

Revert "Fix NUMBER_OF_COLUMNS_DOESNT_MATCH for Distributed table with duplicate ALIAS expressions" - #107846

Merged
vdimir merged 1 commit into
masterfrom
revert-106404-cursor/fix-distributed-duplicate-alias-columns-6333
Jun 18, 2026
Merged

vdimir merged 1 commit into
masterfrom
revert-106404-cursor/fix-distributed-duplicate-alias-columns-6333

Conversation

@vdimir

@vdimir vdimir commented Jun 18, 2026 •

Copy link
Copy Markdown
Member

Reverts #106404

Version info

  • Merged into: 26.6.1.993

@clickhouse-gh

clickhouse-gh Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [cbbd606]

Summary: ✅


AI Review

Summary

This PR mechanically reverts #106404: it removes the StorageDistributed projection disambiguation based on __actionName, restores the older restrictive __actionName contract, and deletes the duplicate-ALIAS Distributed regression test. I do not see a mixed semantic state left behind. The rollback also restores the known NUMBER_OF_COLUMNS_DOESNT_MATCH behavior for duplicate ALIAS columns on Distributed tables until a replacement such as #106402 lands; given the unresolved wrong-result/name-collision concerns in the reverted PR, that tradeoff looks intentional, but it should be made explicit.

Missing context / blind spots
Findings

💡 Nits

  • [src/Functions/identity.h:99] The revert reintroduces the nad typo in a user-visible __actionName diagnostic, with the same spelling in src/Planner/PlannerActionsVisitor.cpp:201.
    Suggested fix: keep the spelling fix from the reverted PR and use and in both diagnostics.
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jun 18, 2026
Comment thread src/Functions/identity.h
{
if (WhichDataType(arg).isString())
continue;
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Function __actionName is internal nad should not be used directly");

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 reintroduces the nad typo in a user-visible diagnostic. Could you keep the spelling fix from the reverted PR and use and here and in the matching PlannerActionsVisitor.cpp error text? That preserves the revert's behavior while avoiding a degraded error message.

@clickhouse-gh

clickhouse-gh Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.30% 85.20% -0.10%
Functions 92.30% 92.30% +0.00%
Branches 77.50% 77.40% -0.10%

Changed lines: Changed C/C++ lines covered by tests: 22/22 (100.00%) | Lost baseline coverage: none · Uncovered code

Full report · Diff report

@vdimir
vdimir added this pull request to the merge queue Jun 18, 2026
Merged via the queue into master with commit 2dbda7a Jun 18, 2026
166 checks passed
@vdimir
vdimir deleted the revert-106404-cursor/fix-distributed-duplicate-alias-columns-6333 branch June 18, 2026 16:59
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 18, 2026
cursor Bot pushed a commit that referenced this pull request Aug 5, 2026
…ning

The disambiguation half of this pull request wrapped duplicate projection items in
`__actionName(expr, '<unique>')`. It relied on the relaxation of `FunctionActionName` that
#106404 made, which
#107846 reverted the day after this branch was cut, so on
current master that wrapper rejects every argument that is not a `String` constant:

    SELECT __actionName(materialize(1) + 1, 'dedup_1');
    -- Code: 36. BAD_ARGUMENTS: Function __actionName is internal nad should not be used directly
    SELECT __actionName(toString(materialize(1)), 'dedup_1');
    -- Code: 44. ILLEGAL_COLUMN: Argument at index 0 for function __actionName must be constant

The duplicate-column reconciliation that superseded it now lives on the initiator, in
`buildShardCollapseFanOut` (#107913).

What remains here is the half that does not depend on any of that: the parallel-replicas entry points
now inline `ALIAS` columns before `buildQueryTreeForShard`, exactly as the Distributed/`remote` path
already does. `ReplaseAliasColumnsVisitor` moves out of `StorageDistributed.cpp` into
`buildQueryTreeForShard.cpp` so all four callers share it, which also removes the byte-identical copy
`InlineAliasColumnsForNamingVisitor` that landed on master in the meantime.

Related: #112246

Co-authored-by: Yakov Olkhovskiy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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