refactor(sds): share typed grouping projections - #637
Merged
Merged
Conversation
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 grouping needs each source column's type and nullability. Names alone cannot distinguish one map-valued column from a set of PromQL labels, or keep numeric and string group identities separate.
Use one
GroupingProjectionof existing Planner columns across precompute configuration,DataDescriptorand state-schema validation. Routing derives label names from that projection. Group types and nullability participate in catalog and policy identity; legacy label lists retain their previous identities and wire shapes through compatibility adapters.Before this PR: grouping definitions stored only names, so typed SQL group projections had no authoritative shared contract.
After this PR: the same typed grouping definition crosses planning, installation and catalog validation. Legacy PromQL groups remain non-null UTF-8 columns. The ClickHouse reader explicitly rejects richer group projections until typed transport is implemented, preventing accidental flattening.
Verification: 84 shared-type tests, 724 control-plane tests and 6 ClickHouse-reader tests pass. Coverage includes legacy wire/identity preservation, type/nullability identity separation and unsupported typed-reader rejection. Production and test targets compile. Full data-plane suite: 1,103 passed; four HTTP/VM fixture or port failures remain on the base revision, with related fixture fixes in the pending #617 stack. Independent bounded source review passed, including the source-aware guard that rejects numeric or nullable time-series grouping.
This is the shared contract prerequisite for grouped SQL execution; it does not claim new query acceleration. Native Map transport and grouped readout follow separately.