rollup join with time partition doesn't query correct parition
- Dominant language
- Rust
- Stars
- 20.8k
- Forks
- 2.1k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 181
Description
**Describe the bug**
with rollupJoin which joining 2 time partition rollup,
cubejs will query 1 rollup with correct time partition, and another rollup without time partition.
**To Reproduce**
Steps to reproduce the behavior:
1. create 2 cubes with time partition rollups,
for example, bill and item cube, item belongs to bill
2. create rollupJoin joining 2 rollups
3. query the rollupJoin, it will query 2 rollups, 1 with time parition, 1 without time partition.
For example,
``` js
cube('Bills', {
sql = '...'
preAggregations = {
defaultRollup: {
type: `rollup`,
external: true,
measureReferences: [],
dimensionReferences: [
Bills.createdAt,
Bills.seqNumber,
Bills.id,
],
timeDimensionReference: Bills.createdAt,
granularity: `minute`,
partitionGranularity: `month`,
}
}
})
cube('Items', {
sql = '...',
joins = {
Bills: {
relationship: 'belongsTo',
sql: `${Items.billId}=${Bills.id}`
};
}
preAggregations = {
defaultRollup: {
type: `rollup`,
external: true,
measureReferences: [
Items.nettTotal,
],
dimensionReferences: [
Items.createdAt,
Items.billId,
],
timeDimensionReference: Items.createdAt,
granularity: `minute`,
partitionGranularity: `month`,
},
billItemRollup: {
type: `rollupJoin`,
external: true,
measureReferences: [
Items.nettTotal,
],
dimensionReferences: [
Items.createdAt,
Items.billId,
Bills.createdAt,
Bills.seqNumber,
Bills.id
],
timeDimensionReference: Items.createdAt,
granularity: `minute`,
partitionGranularity: `month`,
rollupReferences: [Items.defaultRollup,Bills.defaultRollup]
}
}
})
```
**Expected behavior**
expect to query both rollups with time parititon
**Screenshots**
when query billItemRollup, it will query `local_dev_preag.items_default_rollup20210701` and `local_dev_preag.bills_default_rollup`

expected rollup should be `local_dev_preag.bills_default_rollup20210701` instead of `local_dev_preag.bills_default_rollup`
**Version:**
cubejs/cube:v0.27.46
cubejs/cubestore:v0.27.46
Contributor guide
Assessment
This issue has not been assessed yet.