Skip to content

Antalya 26.8: __aliasMarker refactoring to cover complex cases with ALIASes - #2662

Merged
zvonand merged 3 commits into
antalya-26.8from
feature/antalya-26.8/pr-2409
Oct 25, 2026
Merged

zvonand merged 3 commits into
antalya-26.8from
feature/antalya-26.8/pr-2409

Conversation

@zvonand

@zvonand zvonand commented Oct 24, 2026

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

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

Fixed ALIAS columns read through Distributed, Merge over Distributed, and Hybrid tables. A JOIN whose two sides declare a same-named ALIAS column failed with MULTIPLE_EXPRESSIONS_FOR_ALIAS; reading an ALIAS column of a Merge table over a Distributed child failed with NOT_FOUND_COLUMN_IN_BLOCK or returned defaults; reading an ALIAS column of a Hybrid table from inside a subquery failed with THERE_IS_NO_COLUMN; and an ALIAS column referenced from inside a lambda over a Distributed table failed on the shard (#2409 by @mkmkme).

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

Cherry-picked from #2409.


This is the attempt of forward-porting #1844 to 26.6 considering the improvements done in the upstream.

Documentation entry for user-facing changes

...

…next commit)

---
Original cherry-pick message follows:

Merge pull request #2409 from Altinity/mkmkme/26.6/alias-marker

Antalya 26.6: __aliasMarker refactoring to cover complex cases with ALIASes
# Conflicts:
#	src/Analyzer/Utils.cpp
#	src/Interpreters/ClusterProxy/executeQuery.cpp
#	src/Planner/PlannerActionsVisitor.cpp
#	src/Storages/StorageDistributed.cpp
#	src/Storages/StorageMerge.cpp
#	src/Storages/buildQueryTreeForShard.cpp
#	src/Storages/buildQueryTreeForShard.h
#	tests/queries/0_stateless/03648_alias_marker_with_mergeable_state.sh
antalya-26.8 already carries the upstream marker-less inlineAliasColumns
(free functions inlineAliasColumnsImpl / inlineAliasColumnsInExpression);
replace it with the source PR's AliasColumnInliner and the new
inlineAliasColumns(tree, context) signature.

Adapted: parallel-replicas callers of inlineAliasColumns (executeQuery.cpp, findParallelReplicasQuery.cpp) pass context for the re-signatured function
Adapted: actionNameAfterAliasInlining uses AliasColumnInliner{..., false}.inlineExpression in place of the removed inlineAliasColumnsInExpression
Adapted: getExpressionSource keeps the TableExpressionNodePtr return type of antalya-26.8
Adapted: RowPolicyData constructor keeps the antalya-26.8 __row_policy_filter alias approach, which already covers the bare-column policy case
@zvonand zvonand added releasy Created/managed by RelEasy antalya-26.8 Session label (releasy session config) forwardport This is a frontport of code that existed in previous Antalya versions ai-resolved Port conflict auto-resolved by Claude labels Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [4b8725e]

@zvonand zvonand mentioned this pull request Oct 24, 2026
37 tasks done
… 0 for collapse rejection

A `JOIN USING` entry wrapped in `__aliasMarker` is rendered as the bare key name,
so the shard receives `USING (a)` instead of `USING (x AS a)` and cannot resolve
a key that exists only as an `ALIAS` column of the `Distributed` table. Inline
the `USING` sides without markers.

With markers on, duplicate `ALIAS` columns are not collapsed on the shard, so the
`GROUPING SETS` collapse rejection in 04357 is reachable only with
`enable_alias_marker = 0`.

Addresses 2 failing test(s) in Fast test on
#2662. Still-failing set shrank from 2 → 0.
https://altinity-build-artifacts.s3.amazonaws.com/json.html?PR=2662&sha=ee946d812b073a89b9dcd42db857e46510f76f32&name_0=PR&name_1=Fast%20test
@zvonand

This comment was marked as outdated.

@zvonand

zvonand commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

@blau-ai

@blau-ai

blau-ai commented Oct 25, 2026

Copy link
Copy Markdown
Collaborator

CI triage — PR #2662

Verdict: 4 red checks → 0 caused by this PR's source changes. 1 is a stale-branch issue (one merge fixes it), 3 are flaky/infra. SQLLogic has since gone green.

Check Classification Cause
Integration tests (arm_binary, distributed plan, 1/4) — 21/2325 Stale branch (not source-related) Branch is behind base; missing a named-collections privilege backport + its test config
Regression release swarms — 3 scenarios Flaky / infra Connection timeouts in resilience tests
Regression aarch64 swarms — 3 scenarios Flaky / infra Same scenarios, same cause
SQLLogic test ✅ now passing (was still running at first look)

1. Integration tests (arm_binary, distributed plan, 1/4) — stale branch, fixable by merging base

All 21 failures are in a single file, test_storage_iceberg_with_spark/test_export_partition_iceberg.py, and every one dies at the table-creation setup step (attach_ch_iceberg → create_iceberg_table) with the identical error:

Code: 497. DB::Exception: default: Not enough privileges. To execute this query,
it's necessary to have the grant SHOW NAMED COLLECTIONS SECRETS ON s3.

This is not your alias-marker change:

Root cause is that this branch is ~1 day behind antalya-26.8 and missing the upstream backport ClickHouse#123133 ("Require permission to override named collections"), merged to base via ClickHouse#125982 (commit 64c27aa). That backport makes overriding a named collection require the SHOW NAMED COLLECTIONS SECRETS grant, and in the same change it adds the grant to the iceberg test's users config. On base:

# tests/integration/test_storage_iceberg_with_spark/configs/users.d/users.xml  (present on base, absent here)
             <named_collection_control>1</named_collection_control>
+            <show_named_collections_secrets>1</show_named_collections_secrets>

git merge-base --is-ancestor 64c27aa HEAD → NOT in HEAD, confirming the branch predates it.

Concrete fix: merge origin/antalya-26.8 into the PR branch (git merge origin/antalya-26.8, resolve any conflicts in the analyzer/planner files, push). That brings in both the server-side privilege change and the test-config grant, and the 21 tests should pass. Cherry-picking just the one-line users.xml is not enough — the underlying privilege-check behavior (ClickHouse#123133) must come along too, so take the full merge. (I can do the merge + conflict resolution on request.)

2 & 3. Regression swarms (release + aarch64) — flaky/infra, safe to re-run

Both arches fail the identical 3 leaf scenarios — being arch-independent is itself a strong infra signal:

  • cluster discovery / check cluster discovery with wrong cluster name → Code: 279. Cannot connect to any replica for query execution. (ALL_CONNECTION_TRIES_FAILED) on an s3Cluster(...) query.
  • node failure / cpu overload → Code: 209 ... Timeout exceeded while reading from socket ... receive timeout 300000 ms (SOCKET_TIMEOUT).
  • node failure / cpu overload all swarm nodes → same SOCKET_TIMEOUT family.

These are the swarm resilience suite (deliberate node-kill / CPU-overload fault injection against MinIO/object-storage clusters). The errors are transport-level (connect failures, socket timeouts under induced load) — a planner/alias-marker regression would surface as a logical error or wrong result during analysis, not a 300s socket timeout under CPU overload. 1518/1535 scenarios pass. Classification: flaky/infra — safe to re-run; not PR-related.


Bottom line: nothing here points at the __aliasMarker refactoring. Merge antalya-26.8 to clear the integration failures, and re-run the two swarm jobs.

🤖 Generated with Claude Code

@zvonand
zvonand merged commit 248a853 into antalya-26.8 Oct 25, 2026
320 of 327 checks passed
@zvonand zvonand added the verified Approved for release label Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-resolved Port conflict auto-resolved by Claude antalya-26.8 Session label (releasy session config) forwardport This is a frontport of code that existed in previous Antalya versions releasy Created/managed by RelEasy verified Approved for release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants