Caching of pre-aggregations doesn't happen in CubeCloud
- Dominant language
- Rust
- Stars
- 20.8k
- Forks
- 2.1k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 181
Description
**Describe the bug**
Queries don't cache when hitting pre-aggregations
**To Reproduce**
Steps to reproduce the behavior:
1. Build a cube model that uses a pre-aggregate.
2. Fire a query that hits a pre-aggregate (Playground or API)
3. Fire the same query again (should hit cache)
4. Look at the Cubecloud query history and confirm that no cached AND pre-aggregated queries are fired.
**Expected behavior**
I'd expect when firing the same pre-aggregated query twice that it would hit the cache the second time. This works without the pre-aggregation added to the Cube model.
**Screenshots**

**Minimally reproducible Cube Schema**
```javascript
cube(`Orders`, {
sql: `
select 1 as id, 100 as amount, 'new' status
UNION ALL
select 2 as id, 200 as amount, 'new' status
UNION ALL
select 3 as id, 300 as amount, 'processed' status
UNION ALL
select 4 as id, 500 as amount, 'processed' status
UNION ALL
select 5 as id, 600 as amount, 'shipped' status
`,
measures: {
count: {
type: `count`,
},
totalAmount: {
sql: `amount`,
type: `sum`,
},
toRemove: {
type: `count`,
},
},
preAggregations: {
main: {
measures: [
count,
]
},
}
});
```
**Sample data above (top/last 3 queries without pre-agg, others with pre-agg)**

**Real data**

**Version:**
Stable (0.31.55)
Contributor guide
Assessment
This issue has not been assessed yet.