cube-js / cube-js/cube

Support nested/grouped response format in query results

Open
#11,528 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Is your feature request related to a problem? Please describe.**

I'm always frustrated when querying Cube by a dimension (lets say govtScheme) and having to manually transform the flat tabular response into a grouped/nested object structure on the client side for every project.

**Describe the solution you'd like**
An optional query parameter (e.g. groupBy) that tells Cube to return results nested by a specified dimension:
```
{
"NIDESP": [{ "name": "Business Plan A" }],
"JANDHAN": [{ "name": "Business Plan B" }]
}
```

**Describe alternatives you've considered**

Manually reshaping the flat response on the client side using Array.reduce(). This works but adds repetitive boilerplate code across every application consuming the Cube API.

**Additional context**

This would be especially useful for dashboards and reporting tools where data is naturally presented in grouped sections. It reduces client-side complexity and makes Cube's REST API response more directly usable.

Contributor guide

Open the contributing guide

Research direction

No file, test, or code entry point is named. Start by locating Cube's REST API query-result handling and the existing query-parameter flow; define the grouping behavior and verify that the response matches the nested example for the requested dimension.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.