Repository navigation
Introduce Query-Level Storage Virtual Columns - #110186
Conversation
|
Workflow [PR], commit [edf5dc5] Summary: ❌
AI ReviewSummaryThis PR moves modifier-dependent metadata onto the per-query Findings
Tests
Final VerdictRequest changes. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 55/57 (96.49%) · Uncovered code |
| /// Forwarding here keeps metadata observers in sync with the nested storage. | ||
| StorageMetadataHandle getInMemoryMetadataPtr(ContextPtr context_, bool bypass_metadata_cache) const override | ||
| /// NOLINTNEXTLINE(google-default-arguments) | ||
| StorageMetadataHandle getInMemoryMetadataPtr(ContextPtr context_, bool bypass_metadata_cache, std::optional<TableExpressionModifiers> modifiers) const override |
There was a problem hiding this comment.
This still blocks the motivating STREAM case on lazy-loaded ordinary tables. DatabaseOrdinary exposes unloaded tables through StorageTableProxy, but StorageProxy never overrides supportsStreaming, so QueryAnalyzer::validateTableExpressionModifiers sees the proxy and throws before the nested MergeTree / ReplicatedMergeTree is loaded.
The new metadata-forwarding override here will not make FROM t STREAM work through table proxies unless the capability check is delegated as well. After that, the proxy snapshot / read paths also need the modifier-aware wiring from the other comment, otherwise the resolved header and the actual read will still disagree.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 280/395 (70.89%) · Uncovered code |
…ofiles kill-safe
The `LLVM Coverage` gate compares two totals merged from 21 per-shard
`.profdata` artifacts that are `optional=True`, and nothing checked that
either side had all of them. A missing shard on the PR side fails an innocent
PR ("Coverage degraded" by 0.5 pp on a 102-line PR); a missing shard on a
master run writes a low baseline into the CI DB, so later real regressions
pass invisibly. Observed twice in 60 days, both times the same shard:
`Integration tests (amd_llvm_coverage, 4/8)` merged only 20 of 21 profiles
while every check was green.
Examples:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110186&sha=0b33f54bc8089ea3560397c589e93dc6aec92d47&name_0=PR&name_1=LLVM%20Coverage
(ClickHouse#110186)
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=105844&sha=66107bb44ab45a490e839225eb096e46204e5e86&name_0=PR&name_1=LLVM%20Coverage
(ClickHouse#105844)
The invariant: a verdict comes only from two complete measurements.
- Every coverage producer (FT, IT, unit) names its profile after its own
artifact (`<artifact>.profdata`), so the filename carries the shard
identity. Producer merges use `--failure-mode=any` and skip zero-length
`.profraw` inputs: a shard with invalid data is absent, never silently
short. Artifacts stay `optional=True`, so a missing profile never reddens
a green test job.
- The `LLVM Coverage` job checks the expected set against what arrived and
merges an explicit file list (no `*.profdata` glob). On a missing or
invalid shard it reports `SKIPPED` with the shard name and withholds every
comparative output: no verdict, no GitHub comment, no `llvm_coverage.info`,
no CI DB row. Baseline completeness then needs no metadata: the diff script
already selects the first master ancestor that has an `.info`, and after
this change such an `.info` exists only for complete runs.
- Under coverage the IT sequential phase runs regardless of how many parallel
tests failed (`MAX_FAILS_BEFORE_DROP`), so a green shard cannot silently
publish a profile short by the whole sequential phase.
- Root cause of the recurring shard 4/8 loss: a `SIGKILL` during the
exit-time profile write leaves a half-written `.profraw` whose header makes
`llvm-profdata` abort with "LLVM ERROR: out of memory"
(llvm/llvm-project#50970). Coverage builds now
compile with `-mllvm -runtime-counter-relocation` and run with `%c`
(continuous mode): counters are memory-mapped into the file, which is valid
at every instant, so kills lose nothing and corrupt nothing.
Related: ClickHouse#112832
Co-Authored-By: Claude Fable 5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
This patch is a part of #106169. This patch allows changing storage metadata inside the query scope depending on table expression modifiers.
For example, for streaming queries, there will be additional syntax for watermarks:
This query will introduce 2 additional virtual columns to the reading plan from such a table:
_watermarkand_time_attribute.Version info
26.8.1.816(included in26.8and later)