Skip to content

refactor(sds): share typed grouping projections - #637

Merged
zzylol merged 3 commits into
mainfrom
refactor/typed-grouping-projection
Sep 11, 2026
Merged

zzylol merged 3 commits into
mainfrom
refactor/typed-grouping-projection

Conversation

@zzylol

@zzylol zzylol commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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 GroupingProjection of existing Planner columns across precompute configuration, DataDescriptor and 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.

@zzylol
zzylol marked this pull request as ready for review September 11, 2026 12:52
@zzylol
zzylol merged commit e7b3669 into main Sep 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant