Skip to content

Storage merge always proxy virtuals to underlying storages - #102471

Merged
alexey-milovidov merged 3 commits into
masterfrom
merge_proxy_virtuals
Apr 13, 2026
Merged

alexey-milovidov merged 3 commits into
masterfrom
merge_proxy_virtuals

Conversation

@Michicosun

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

After #102304 was merged, the storage merge can omit handling of virtual columns.

@clickhouse-gh

clickhouse-gh Bot commented Apr 11, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [5f7cbfe]

Summary: ✅


AI Review

Summary

This PR removes StorageMerge-specific ad-hoc handling for _table/_database and consistently relies on child storage snapshots to expose virtual columns. The refactor simplifies the ReadFromMerge path (removing AST/query-plan patching for these virtuals) and aligns column resolution/access checks with snapshot-provided virtuals. I did not find high-confidence correctness, safety, concurrency, or performance regressions in the modified paths.

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: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Apr 11, 2026
Comment thread src/Storages/StorageMerge.cpp Resolved
@clickhouse-gh

clickhouse-gh Bot commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.00% 84.00% +0.00%
Functions 90.90% 90.90% +0.00%
Branches 76.50% 76.50% +0.00%

Changed lines: 98.08% (51/52) | lost baseline coverage: 57 line(s) · Uncovered code

Full report · Diff report

@alexey-milovidov alexey-milovidov self-assigned this Apr 13, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Apr 13, 2026
Merged via the queue into master with commit 38fd5d3 Apr 13, 2026
164 checks passed
@alexey-milovidov
alexey-milovidov deleted the merge_proxy_virtuals branch April 13, 2026 05:56
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 13, 2026
pull Bot pushed a commit to Dream-hu/ClickHouse that referenced this pull request Jun 14, 2026
Verifies that selecting `_table` and `_database` from a `Merge` over a
`Distributed` table together with a `LEFT JOIN` returns the real virtual
column values when the analyzer is enabled.

Issue: ClickHouse#84139
Fixed by:
  - ClickHouse#102304
  - ClickHouse#102471

Co-authored-by: Yakov Olkhovskiy <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member

@Michicosun, this change introduced a bug in master.

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.

3 participants