Repository navigation
Fix NOT_FOUND_COLUMN_IN_BLOCK for virtual columns under parallel replicas - #108451
Conversation
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-worker-slot-0:20260625-074000 |
|
cc @KochetovNicolai @nickitat could you review this? It fixes #106561: under the parallel-replicas estimation path, |
|
Workflow [PR], commit [16e7aeb] Summary: ✅
AI ReviewSummaryThis PR fixes Final VerdictStatus: ✅ Approve |
…icas The parallel-replicas estimation path (parallel_replicas_min_number_of_rows_per_replica > 0 over a MergeTree table) runs collectFiltersForAnalysis, which replaces the real table with a StorageDummy. StorageDummy::createVirtuals registered only _table/_database and dropped the original storage's own virtuals (_part, _partition_id, ...), so a query expanding those (e.g. SELECT * with asterisk_include_virtual_columns = 1) threw NOT_FOUND_COLUMN_IN_BLOCK when the dummy snapshot was asked for the sample block. The dummy already holds the original storage snapshot, so just copy its virtual columns. Falls back to _table/_database when there is no original snapshot. Closes: ClickHouse#106561 Co-Authored-By: Claude Opus 4.8 <[email protected]>
a20c0f0 to
e0eb326
Compare
|
Done, both addressed.
One note: the repro has to stay the bare `SELECT *` (kept it as `... FORMAT Null` to avoid printing the unstable `_part_uuid`/etc. columns). Wrapping it (`SELECT c0 FROM (SELECT * ...)`) or selecting an explicit virtual does not reproduce, the outer projection prunes `_part` before it reaches the dummy. Verified the test fails with NOT_FOUND_COLUMN_IN_BLOCK without the fix and passes with it (30/30 under randomization). |
CI finish ledger — e0eb326CI has fully finished (Finish Workflow passed; last check 2026-06-25 16:23). This PR is a StorageDummy virtual-columns fix (parallel-replicas planning, #106561); none of the failures below are caused by it. Every red check has an owner; only
The fix (StorageDummy::createVirtuals plain copy per @ Michicosun's request) + minimal single-line repro test are green. None of the four reds touch StorageDummy or the parallel-replicas planning path. Ready for review. Session id: cron:our-pr-ci-monitor:20260625-170000 |
|
@groeneai merge master |
…-dummy-virtual-columns-parallel-replicas
|
@Michicosun merged current master into the branch (head |
CI finish ledger - 262b6dbEvery failure below has an owner: a fixing PR (ours or external). Only
Session id: cron:our-pr-ci-monitor:20260627-023000 |
262b6db to
16e7aeb
Compare
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 11/13 (84.62%) | Lost baseline coverage: none · Uncovered code |
CI finish ledger — 16e7aebEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only
Session id: cron:our-pr-ci-monitor:20260629-140000 |
CI finish ledger — 16e7aeb (corrected)Correction to the prior ledger comment: the Upgrade-check line has an existing open fixing PR (#108560, ours), so it is linked here per the ledger rule (a fixing PR is always preferred over a fix-task disposition). Neither failure is PR-caused — this PR's diff is
Session id: cron:our-pr-ci-monitor:20260629-140000 |
CI finish ledger: owner update for STID 1154-240eCompleting the previously-placeholdered AST-fuzzer line. The fixing PR is now identified and the failure is reproduced and root-caused locally.
Correction to the earlier parenthetical ("FunctionComparison emits FCmp over f64 vs i32 without common-type promotion"): that preliminary read was wrong. Actual root cause: the SELECT a, (SELECT b WHERE and(1048575, materialize(7), NULL) GROUP BY 1, '' QUALIFY equals(b, -2147483648)), '\0'
FROM numbers_mt(65536) WHERE toDecimal256('-1', NULL)
GROUP BY (number / number) AS b, number AS a, '...', '2.57' WITH ROLLUP WITH TOTALS LIMIT 1048576Under ROLLUP the decorrelated correlated column is fed as Not PR-caused: this PR's diff is Session id: cron:clickhouse-worker-slot-0:20260629-142400 |
3174567
…o-read-setting
The branch was ~11.7k commits behind (last merge 2026-06-20) and red. The
diff vs. `master` is still the single randomizer line — no functional change:
"parallel_replicas_min_number_of_rows_per_replica": lambda: random.randint(0, 1),
Reason to re-merge now: the parallel-replicas owners have landed several
directly relevant fixes since 2026-06-20, so refreshing CI on today's
`master` will narrow the remaining set of genuine product bugs this PR is
meant to surface:
- #108451 (`Fix NOT_FOUND_COLUMN_IN_BLOCK for virtual columns under parallel
replicas`, closes #106561) — should clear the tracked
`04098_asterisk_include_virtual_columns_mergetree` failure.
- #101434 (`Reimplement reading in order for parallel replicas`) — bears
directly on the `max_rows_to_read`-not-honored class
(`02155_read_in_order_max_rows_to_read`, `00945_bloom_filter_index`).
- #109003 (`Fix server abort on GROUPING SETS in a set operation with
parallel replicas`) — a "Server died" class fix.
- Flaky-test fix for `04051_pk_analysis_stats`.
Conflicts were all in files the branch does not intentionally change (its
only intended change is the one `tests/clickhouse-test` line); they were
resolved by taking `master`'s version. No pinning/blacklisting of the
affected parallel-replicas tests — that would mask the very signal this PR
exists to produce.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…1-dummy-virtual-columns-parallel-replicas Fix NOT_FOUND_COLUMN_IN_BLOCK for virtual columns under parallel replicas
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix
NOT_FOUND_COLUMN_IN_BLOCKerror (e.g.Column _part not found) when selecting virtual columns from aMergeTreetable under parallel replicas, including viaSELECT *withasterisk_include_virtual_columns = 1.Description
Closes: #106561
During planning, the parallel-replicas estimation path (
parallel_replicas_min_number_of_rows_per_replica > 0over aMergeTreetable) runscollectFiltersForAnalysis, which replaces the real table with aStorageDummyviareplaceTableExpressionsWithDummyTables.StorageDummy::createVirtualsonly registered_table/_databaseand dropped the original storage's own virtual columns (_part,_partition_id, ...).When a query requested one of those virtuals together with
_table/_database(for exampleSELECT *withasterisk_include_virtual_columns = 1, which expands to include_part),StorageWithCommonVirtualColumns::readcalledstorage_snapshot->getSampleBlockForColumnson the dummy snapshot, which could not resolve_partand threwNOT_FOUND_COLUMN_IN_BLOCK.The dummy already holds the original storage snapshot, so
createVirtualsnow preserves the original storage's virtual columns; the dummy resolves the same virtuals the real table does._table/_databaseare still added at thePlanplace (the dummy materializes them as constants), so their handling is unchanged.Reproducer (from the issue, https://fiddle.clickhouse.com/cbdef536-f180-4922-8ad3-9495d97d9a13):
Version info
26.7.1.434(included in26.7and later)