cube-js / cube-js/cube

rollup join with time partition doesn't query correct parition

Open
#3,081 0 comments 1 reaction 1 assignee Claimed by @paveltiunov View on GitHub
pre-aggregations question
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`
![Screenshot from 2021-07-05 18-08-58](https://user-images.githubusercontent.com/24311533/125045977-24ca7700-e0d0-11eb-884a-e25e74ef4582.png)
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

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.