cube icon indicating copy to clipboard operation
cube copied to clipboard

rollup pre-aggregation alias bug

Open HsienWeiWang opened this issue 4 years ago • 6 comments

Describe the bug When using rollup type pre-aggregation, the alias name of the measure is the same before and after aggregation. So, when adding a filter on the measure, BigQuery is not able to distinguish in the "having" clause, causing Aggregations of aggregations are not allowed error.

To Reproduce (I am using BigQuery, not sure whether any other DW has the same issue)

  1. Define any measure in rollup type pre-aggregation
  2. Select the measure in playground
  3. Add any filter on that measure
  4. See error

Expected behavior Maybe change the alias format in pre-aggregation

Screenshots image

Version: 0.28.41

HsienWeiWang avatar Oct 13 '21 15:10 HsienWeiWang

If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you. If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.

github-actions[bot] avatar Oct 14 '21 17:10 github-actions[bot]

Hey @HsienWeiWang ! The use of internal pre-aggregations isn't encouraged. You can use Cube Store in order to workaround this problem.

paveltiunov avatar Oct 19 '21 07:10 paveltiunov

@HsienWeiWang Any workaround you have found for this or have you just started using CubeStore?

rajatch80 avatar Apr 08 '24 09:04 rajatch80

@rajatch80 Does this reproduce for you as well? On which version of Cube (if you don't mind sharing)?

Indeed, storing pre-aggregations in the original data source is not recommended. Please use Cube Store.

igorlukanin avatar Apr 08 '24 10:04 igorlukanin

I am using the latest version of Cube. I am comparing two data sources (Snowflake and Clickhouse). Hence, I wanted to do it without cubestore first. Is there no way without using cubestore?

rajatch80 avatar Apr 08 '24 11:04 rajatch80

@rajatch80 If you don't want to use Cube Store, you can comment out the pre-aggregations in your data model and have Cube query your upstream data sources directly.

igorlukanin avatar Apr 09 '24 10:04 igorlukanin

Using external databases for pre-aggregations has been deprecated. Please use Cube Store instead. Looks like this issue is not relevant anymore, so closing it.

igorlukanin avatar Sep 25 '24 14:09 igorlukanin