feat(v2.6.0): aggregates with derived GROUP BY - #29
Merged
Merged
Conversation
Engine: - Per-picked-column aggregate functions (COUNT, COUNT DISTINCT, SUM, AVG, MIN, MAX). Non-aggregated picks become GROUP BY in pick order; GROUP BY is omitted when every pick is aggregated; ORDER BY can target the aggregate expression; DISTINCT is suppressed with a provenance note because GROUP BY already collapses rows. Unknown functions are ignored. - Query files move to version 2; version-1 files migrate forward with empty aggregates, and newer versions are rejected. Panel: - Each picked-column chip gains an aggregate selector; DISTINCT disables while grouping; a plan tip explains one-to-many multiplication; aggregates are pruned with their picks, saved, exported, and restored. Tests: five aggregate engine records, version-1 migration, storage/prune updates, and six ERD UI checks (68 total).
- ADR-003 records derived GROUP BY, the six functions, the DISTINCT suppression, aggregate ordering, and the version-2 migration, with the rejected alternatives (HAVING, explicit GROUP BY, COUNT(*), window functions). - QUERY_BUILDER.md gains the aggregates section, the v2 file sample, and the updated non-goals; USER_GUIDE and README mention the selector; ARCHITECTURE notes aggregate emission.
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.
What
v2.6.0 feature work: aggregate functions with derived
GROUP BY, plus the version-2 query file format.1.
feat(erd): aggregates with derived GROUP BYCOUNT,COUNT DISTINCT,SUM,AVG,MIN,MAX.GROUP BYin pick order; omitted when every pick is aggregated; aggregate expressions get deterministic aliases (count_orderheader_orderid).ORDER BY COUNT(...) DESC).DISTINCTis disabled and suppressed with a provenance note while grouping; a plan tip explains one-to-many multiplication.2.
docs(erd): document aggregates and record ADR-003COUNT(*), window functions).docs/QUERY_BUILDER.mdgains the aggregates section and the v2 file sample; USER_GUIDE and README mention the selector; ARCHITECTURE notes aggregate emission.Verification
typecheck,build,test:filegreen locally;metrics,package:smoke, Firefox smoke run in CIdist/rebuilt and committed; no version bump yet — the release commit follows after merge