Deferred from: add-time-bucket-aggregation (see openspec/changes/add-time-bucket-aggregation/proposal.md Non-goals).
The first cut of the ad-hoc aggregation primitive supports exactly one groupBy.field per request. Multi-field grouping (e.g. groupBy: [status, priority]) would let charts render stacked / pivoted views without two round-trips. Out of scope for the initial PR because:
- Most chart libraries can't render multi-dim series natively — clients typically post-process anyway.
- Result-set size explodes:
N × M buckets vs N.
- Backend translators (Postgres
GROUP BY a, b, Solr pivot.facet, ES nested terms) each need their own work.
Scope when picked up:
- Extend
AggregationQuery to accept groupBy: { fields: string[] }.
- Extend
AggregationRunner::tryNativeAggregation() for Postgres GROUP BY a, b + result reshaping.
- Solr
pivot.facet translator + ES nested terms translator.
- GraphQL:
GroupByInput.fields: [String!] (additive — keep field working for backwards-compat).
- REST: accept comma-separated
field=a,b.
- Response shape extension:
groups[i].keys: { a, b } alongside the existing flat groups[i].key for single-field requests.
Deferred from:
add-time-bucket-aggregation(seeopenspec/changes/add-time-bucket-aggregation/proposal.mdNon-goals).The first cut of the ad-hoc aggregation primitive supports exactly one
groupBy.fieldper request. Multi-field grouping (e.g.groupBy: [status, priority]) would let charts render stacked / pivoted views without two round-trips. Out of scope for the initial PR because:N × Mbuckets vsN.GROUP BY a, b, Solrpivot.facet, ES nestedterms) each need their own work.Scope when picked up:
AggregationQueryto acceptgroupBy: { fields: string[] }.AggregationRunner::tryNativeAggregation()for PostgresGROUP BY a, b+ result reshaping.pivot.facettranslator + ES nestedtermstranslator.GroupByInput.fields: [String!](additive — keepfieldworking for backwards-compat).field=a,b.groups[i].keys: { a, b }alongside the existing flatgroups[i].keyfor single-field requests.