You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MetricFlow will apply a date_trunc on time dimensions to make sure they conform the the specified granularity. i.e we will render this SQL for the following dimension date_trunc('day', data_dt)
- name: data_dt
type: time
is_partition: True
type_params:
time_granularity: day
The issue is that Snowflake, and likely other engines, won't respect partition pruning on data_dt if we apply a date trunc function. We need a way to respect partition pruning for time dimension
Possible Solutions
We could expose a way to make the date trunc function optional i.e
- name: data_dt
type: time
is_partition: True
type_params:
time_granularity: day
enfore_granularity: false #default true
This could lead to some odd behavior with time based joins, where we expect every dimension to conform to the specified grain. The expectation would be that the user makes sure the dimension is add the right grain downstream to guarantee all time based joins will work.
Summary
MetricFlow will apply a
date_trunc
on time dimensions to make sure they conform the the specified granularity. i.e we will render this SQL for the following dimensiondate_trunc('day', data_dt)
The issue is that Snowflake, and likely other engines, won't respect partition pruning on
data_dt
if we apply a date trunc function. We need a way to respect partition pruning for time dimensionPossible Solutions
We could expose a way to make the date trunc function optional i.e
This could lead to some odd behavior with time based joins, where we expect every dimension to conform to the specified grain. The expectation would be that the user makes sure the dimension is add the right grain downstream to guarantee all time based joins will work.
From SyncLinear.com | SL-3069
The text was updated successfully, but these errors were encountered: