-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 containing nullable decimal measures fail in Athena Driver #9010
Comments
Hi @Larissa-Rocha 👋 I've tried to reproduce this and while I wasn't able to get exactly the same error, I acknowledge that this case could have been handled better. The data model that I used: cubes:
- name: test
sql: >
SELECT
NULL AS value,
NULL AS value_workload_minutes,
NULL AS value_workload_minutes_count,
TRUE AS flag_enrollment_completed_pathway
dimensions:
- name: value
sql: value
type: string
measures:
- name: value_workload_total
sql: 1000 * ROUND(CAST(value_workload_minutes AS DOUBLE)/cast(value_workload_minutes_count as double), 3)
type: sum
- name: value_workload_total_completed
sql: 1000 * ROUND(CAST(value_workload_minutes AS DOUBLE)/cast(value_workload_minutes_count as double), 3)
type: sum
filters:
- sql: flag_enrollment_completed_pathway = TRUE
pre_aggregations:
- name: main
dimensions:
- value
measures:
- value_workload_total
- value_workload_total_completed Pre-aggregation does not build—here's the error:
My Cube version was v1.1.7. That being said, I guess that a possible workaround would be to safeguard against |
Hi @igorlukanin, after further investigation, I found that pre aggregation in columns containing special characters like |
Hi @Larissa-Rocha 👋 I've quickly checked it with the following data model: cubes:
- name: test_2
sql: >
SELECT 'á' AS value UNION ALL
SELECT 'â' AS value UNION ALL
SELECT '"' AS value
dimensions:
- name: value
sql: value
type: string
pre_aggregations:
- name: main
dimensions:
- value So I guess there's something else that should be causing that error. Could you please help narrow this down? |
Hi @igorlukanin!
In the example above, titles like '"Title" x "Subtitle"' and '"Title" \ "Subtitle"' contain multiple double quotes, which appears to be causing the issue. When titles include only one or two double quotes, the CSV appears to be generated correctly. |
Describe the bug
I'm trying to pre-aggregate a measure that contains a decimal value, while other measures can be NULL, and I'm having the following error in pre-aggregation:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the metric to pre aggregate
Version:
[e.g. 1.0.5]
Additional context
I found a similar issue here: #6693 for snowflake driver, I wonder how to solve it for athena
The text was updated successfully, but these errors were encountered: