Execute typed SQL grouping through SummaryStore - #641
Merged
Merged
Conversation
zzylol
marked this pull request as ready for review
September 11, 2026 03:52
zzylol
changed the base branch from
stack/clickhouse-map-dependencies
to
main
September 11, 2026 13:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SQL summaries grouped by native ClickHouse
Map(String, String)columns could be planned but could not be materialized or returned through the shared execution path. This change derives typed source grouping from the selected Planner DAG and carries each column as one group value through backfill, SummaryStore, and relational readout.The existing shared grouping projection owns the versioned, lossless group encoding. Its version participates in catalog semantics and state identity, preventing reuse of previously flattened group state. ClickHouse exact leaves and local Arrow results preserve Map entry order, duplicate keys, and nullable values; JSON and TSV rendering retain those entries.
Before:
SELECT labels, max(value) ... GROUP BY labelsfailed automatic publication or fell back during readout. After: automatic planning installs the grouped summary, and a real process test returns the original values after source rows have been removed. Existing SUM/count hybrid cases retain ordinary exact DAG dependencies.Verification: 87 shared tests, 728 control-plane tests, and all 23 ClickHouse runtime tests pass. The previous full data-plane run passed 1111/1112; its one stale grouping fixture was corrected and included in the passing focused suite. The final-head real ClickHouse process differential passed in 5.55 seconds, including original arithmetic timestamp bounds and source deletion after backfill. Independent source review passed at c825e80.
A separate original 27-query run on 12,236,002 samples recorded 3 warm queries, 18 successful exact fallbacks, and 6 native/fallback memory-limit failures. All 21 successful outputs have equal decoded JSON metadata and data. This is correctness coverage, not a new performance result or proof for arbitrary duplicate-key inputs.
Nullable group columns, floating/timestamp grouping, and computed grouping expressions remain unsupported. TSV supports integer groups; JSON containing 64-bit integers, nested Map timestamps, or client output-format overrides falls back until its output policy is explicit. This stack depends on typed grouping (#637), runtime fixes (#617), and safe SQL count inputs (#632); the isolated implementation diff starts at 5c2f038.