Repository navigation
Add test: Flattened xxxMap inside a Tuple whose key array is in the sorting key is excluded from summation — break at SummingSortedAlgorithm.cpp:495 untested - #107193
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Workflow [PR], commit [e7e1d45] Summary: ❌
AI ReviewSummaryThis test-only PR adds a stateless regression test for Missing context / blind spots
Final VerdictStatus: ✅ Approve |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 313 line(s), 18 function(s) across 108 file(s) · Details Top files
|
f844890
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path(s), found during automated review of PR #98039.
That PR Adds immutable MergeTree setting
allow_tuple_element_aggregation(default off). When enabled,SummingMergeTree/AggregatingMergeTree/CoalescingMergeTreerecursively flattenTuplecolumns via newNested::flattenTupleRecursive/reconstructTupleColumnsRecursivehelpers and aggregate each le1. Flattened
xxxMapinside aTuplewhose key array is in the sorting key is excluded from summation —breakat SummingSortedAlgorithm.cpp:495 untestedsrc/Processors/Merges/Algorithms/SummingSortedAlgorithm.cpp:495Risk:
defineColumnsdiscovers the flattened leavesmetrics.ratesMap.ID/metrics.ratesMap.Valueas a real sumMap, then the map loop at SummingSortedAlgorithm.cpp:491-495 checks whether any map column is in the sorting/partition key and, if so,breaks to push the whole map intocolumn_numbers_not_to_aggregate. RISK: if this exclusion is broken/inverted, a map keyed by a sort-key column would be silently merged by key, producing wrong aggregated results and potential sort-order violations …What's unique vs PR tests: PR Test 9 (
03802_summing_merge_tree_tuple_element.sql) covers a flattened map withORDER BY idwhere the map IS summed. No PR test places the flattened map's key leaf in the sorting key, so the map-exclusionbreakat line 495 is never exercised by the PR's own tests.Try it on ClickHouse Fiddle
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes
Version info
26.6.1.670