Repository navigation
Fix Block structure mismatch exception in MaterializingCTETransform - #100573
Conversation
`addMaterializingCTETransform` was not calling `dropTotalsAndExtremes` before transforming the pipeline, unlike the similar `addCreatingSetsTransform`. When a CTE with `WITH TOTALS` was materialized and referenced multiple times, the totals ports survived with the original header while the main output became empty. When uniting multiple CTE pipelines, `uniteTotals` tried to connect these non-empty totals ports to a `ConcatProcessor` created with the empty common header, causing a Block structure mismatch. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100404&sha=4e239671fdc3523725369f5ad6028b4a52c43b45&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%2C%20old_compatibility%29 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
Workflow [PR], commit [41b7fe2] Summary: ✅ AI ReviewSummaryThis PR fixes a real pipeline inconsistency in ClickHouse Rules
Final Verdict
|
The test needs `enable_materialized_cte = 1` (off by default) and two distinct CTEs each referenced twice, so that `MaterializingCTEsStep` enters the `unitePipelines` code path where the totals mismatch occurs. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
novikd
left a comment
There was a problem hiding this comment.
Maybe we want to backport it to 26.3, and then the PR category should be "Not for the changelog"?
The rest looks good to me.
|
The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix. |
LLVM Coverage Report
Changed lines: 100.00% (5/5) · Uncovered code |
…aterializingCTETransform
Backport #100573 to 26.3: Fix Block structure mismatch exception in MaterializingCTETransform
addMaterializingCTETransformwas not callingdropTotalsAndExtremesbefore transforming the pipeline, unlike the similaraddCreatingSetsTransform. When a CTE withWITH TOTALSwas materialized and referenced multiple times, the totals ports survived with the original header while the main output became empty. When uniting multiple CTE pipelines,uniteTotalstried to connect these non-empty totals ports to aConcatProcessorcreated with the empty common header, causing a Block structure mismatch.Found in: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100404&sha=4e239671fdc3523725369f5ad6028b4a52c43b45&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%2C%20old_compatibility%29
#100404
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix Block structure mismatch exception when using materialized CTEs with
WITH TOTALSreferenced multiple times.Documentation entry for user-facing changes
Version info
26.4.1.84826.3.9.2