Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-aggregations would not build if they only contain count_distinct_approx measures #8916

Open
igorlukanin opened this issue Nov 6, 2024 · 0 comments
Assignees
Labels
bug Something isn't working pre-aggregations Issues related to pre-aggregations

Comments

@igorlukanin
Copy link
Member

igorlukanin commented Nov 6, 2024

Describe the bug
If a pre-aggregation contains only count_distinct_approx measures (one, two, etc.) and no other dimensions or measures, it will not build. Instead, the an error is shown.

To Reproduce
Steps to reproduce the behavior:

  1. Take the data model below.
  2. Run a query to the mes measure in Playground so that a p-reaggregation build is triggered.
  3. See the following error:
Error during create table:
CREATE TABLE prod_pre_aggregations.my_cube_test_main_qilx5vis_ieu50pzh_1jimlbg (`my_cube_test__mes` BYTES) LOCATION ?:
Sort key size can't be 0 for default, columns: [Column { name: "my_cube_test__mes", column_type: Bytes, column_index: 0 }]

Expected behavior
The pre-aggregation builds.

Screenshots
Screenshot 2024-11-06 at 12 39 45

Minimally reproducible Cube data model

cube(`my_cube_test`, {
  sql: `
    SELECT 123 AS abc UNION ALL
    SELECT 234 AS abc UNION ALL
    SELECT 345 AS abc
  `,

  measures: {
    mes: {
      sql: `abc`,
      type: `count_distinct_approx`
    }
  },

  pre_aggregations: {
    main: {
      measures: [ mes ]
    }
  }
})

Version:
v1.1.2

Additional context
Adding a count measure or a dimension to the pre-aggregation definition makes the error go away.

@igorlukanin igorlukanin added bug Something isn't working pre-aggregations Issues related to pre-aggregations labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pre-aggregations Issues related to pre-aggregations
Projects
None yet
Development

No branches or pull requests

2 participants