-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Describe the bug
In YAML-based data models, an array is accepted for the time_dimension parameter in a pre-aggregation definition. This data model compiles but fails at runtime, when the query comes.
Changing the time dimension definition to the following fixes it:
time_dimension: CUBE.x_order_created_atTo Reproduce
Steps to reproduce the behavior:
- Use the following data model.
- Run a query.
{
"dimensions": [
"orders_yml.x_merchant_name"
],
"timeDimensions": [],
"order": {
"orders_yml.x_merchant_name": "asc"
}
}- See the error.
Typename.split is not a function
TypeError: name.split is not a function
at CubeStoreQuery.aliasName (/cube/node_modules/@cubejs-backend/schema-compiler/src/adapter/BaseQuery.js:2205:23)
at BaseTimeDimension.unescapedAliasName (/cube/node_modules/@cubejs-backend/schema-compiler/src/adapter/BaseTimeDimension.ts:63:26)
at /cube/node_modules/@cubejs-backend/schema-compiler/src/adapter/PreAggregations.js:1340:53
at _map (/cube/node_modules/@cubejs-backend/schema-compiler/node_modules/ramda/src/internal/_map.js:7:19)
...
Expected behavior
This data model should fail at compile time with a clear error message.
Minimally reproducible Cube Schema
cubes:
- name: orders_yml
data_source: my_analytics
sql_table: public.my_orders
dimensions:
- name: x_merchant_name
sql: x_merchant_name
type: string
- name: x_order_created_at
sql: x_created_at
type: time
pre_aggregations:
- name: orders_rollup
type: rollup
dimensions:
- CUBE.x_merchant_name
time_dimension:
- CUBE.x_order_created_at
granularity: dayVersion:
v1.1.16
Additional context
Reported by Embeddable in Slack: https://cube-js.slack.com/archives/C04KDTE2EF7/p1737652938177579