cube-js / cube-js/cube

rollingWindow measure pre aggregations don't work for MS SQL data sources

Open
#6,813 1 comment 0 reactions 0 assignees View on GitHub
driver:mssql question
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Describe the bug**
Pre aggregations don't work for rollingWindow measures when the data source is MS SQL. The refresh scheduler reports an error: `Error: Time series queries without dateRange aren't supported` which comes from the MS SQL schema compiler adapter.

I have tried defining `partition_granularity` with `build_range_start` and `build_range_end` to put some bounds on the ranges pre aggregated, but that doesn't help the issue.

**To Reproduce**
Set up a pre aggregation for a measure that uses `rollingWindow`.

**Expected behavior**
It should pre aggregate the data correctly.

**Actual behavior**
The refresh scheduler reports an error: `Error: Time series queries without dateRange aren't supported`

**Minimally reproducible Cube Schema**

```javascript
cube(`session`, {
sql_table: `test_db`,
data_source: `default`,
measures: {
weeklyCount: {
sql: `id`,
type: `count`,
rollingWindow: {
leading: `1 week`,
offset: `start`,
},
},
},
dimensions: {
created_at: {
sql: `${CUBE}."created_at"`,
type: `time`
}
},
preAggregations: {
main: {
measures: [session.weeklyCount],
timeDimension: session.created_at,
granularity: `day`
}
}
});
```

**Version:**
0.33.33

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.