Skip to content

Commit

Permalink
Update rendering to use date_trunc on base time dimension granularity
Browse files Browse the repository at this point in the history
MetricFlow's initial time dimension select statement rendering
was built on the assumption that the granularity configred for a given
time dimension would always match the granularity of the values stored.
For example, if a time dimension was defined with granularity DAY, we
assumed that the values in the warehouse would always correspond to
daily granularity data, and would never be offset from a day boundary.

This assumption is flawed for a variety of reasons - yearly or quarterly
granularities might use different offset boundaries, users may
misconfigure dimensions or allow offset values into the dataset which
could be safely corrected, etc.

This change updates our rendering to apply the date_trunc operation on
the base time dimension column, just as we do for the other, coarser
granularities. The one exception is for the base granularity column
for validity window time dimensions, which must retain their underlying
granularity in order to remain viable as validity window boundaries
for any DAILY granularity contexts, as we do not support smaller than
daily granularities at this time.

Note this may cause queries with start and end time constraints to
no longer trigger partition pruning, an issue which will be addressed
in subsequent updates.
  • Loading branch information
tlento authored and sarbmeetka committed Nov 3, 2023
1 parent 53cd55f commit 21b03b7
Show file tree
Hide file tree
Showing 663 changed files with 7,386 additions and 7,367 deletions.
7 changes: 7 additions & 0 deletions .changes/unreleased/Fixes-20231005-124722.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Fixes
body: Coerce time granularity to configured value to prevent finer-grained timestamps
from causing unexpected query behavior
time: 2023-10-05T12:47:22.662371-07:00
custom:
Author: tlento
Issue: "714"
22 changes: 17 additions & 5 deletions metricflow/dataset/convert_semantic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,24 @@ def _convert_time_dimension(
time_granularity=defined_time_granularity,
)
time_dimension_instances.append(time_dimension_instance)
select_columns.append(
SqlSelectColumn(
expr=dimension_select_expr,
column_alias=time_dimension_instance.associated_column.column_name,

# Until we support minimal granularities, we cannot truncate for
# any time dimension used as part of a validity window, since a validity window might
# be stored in seconds while we would truncate to daily.
if dimension.validity_params:
select_columns.append(
SqlSelectColumn(
expr=dimension_select_expr,
column_alias=time_dimension_instance.associated_column.column_name,
)
)
else:
select_columns.append(
SqlSelectColumn(
expr=SqlDateTruncExpression(time_granularity=defined_time_granularity, arg=dimension_select_expr),
column_alias=time_dimension_instance.associated_column.column_name,
)
)
)

# Add time dimensions with a smaller granularity for ease in query resolution
for time_granularity in TimeGranularity:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Read Elements From Semantic Model 'revenue'
SELECT
revenue_src_10006.revenue AS txn_revenue
, revenue_src_10006.created_at AS ds__day
, DATE_TRUNC(revenue_src_10006.created_at, day) AS ds__day
, DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS ds__week
, DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month
, DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day
, EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS ds__extract_dow
, EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS ds__extract_doy
, revenue_src_10006.created_at AS company__ds__day
, DATE_TRUNC(revenue_src_10006.created_at, day) AS company__ds__day
, DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week
, DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month
, DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Read Elements From Semantic Model 'id_verifications'
SELECT
1 AS identity_verifications
, id_verifications_src_10003.ds AS ds__day
, DATE_TRUNC(id_verifications_src_10003.ds, day) AS ds__day
, DATE_TRUNC(id_verifications_src_10003.ds, isoweek) AS ds__week
, DATE_TRUNC(id_verifications_src_10003.ds, month) AS ds__month
, DATE_TRUNC(id_verifications_src_10003.ds, quarter) AS ds__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day
, EXTRACT(dayofweek FROM id_verifications_src_10003.ds) AS ds__extract_dow
, EXTRACT(dayofyear FROM id_verifications_src_10003.ds) AS ds__extract_doy
, id_verifications_src_10003.ds_partitioned AS ds_partitioned__day
, DATE_TRUNC(id_verifications_src_10003.ds_partitioned, day) AS ds_partitioned__day
, DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS ds_partitioned__week
, DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS ds_partitioned__month
, DATE_TRUNC(id_verifications_src_10003.ds_partitioned, quarter) AS ds_partitioned__quarter
Expand All @@ -26,7 +26,7 @@ SELECT
, EXTRACT(dayofweek FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow
, EXTRACT(dayofyear FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy
, id_verifications_src_10003.verification_type
, id_verifications_src_10003.ds AS verification__ds__day
, DATE_TRUNC(id_verifications_src_10003.ds, day) AS verification__ds__day
, DATE_TRUNC(id_verifications_src_10003.ds, isoweek) AS verification__ds__week
, DATE_TRUNC(id_verifications_src_10003.ds, month) AS verification__ds__month
, DATE_TRUNC(id_verifications_src_10003.ds, quarter) AS verification__ds__quarter
Expand All @@ -38,7 +38,7 @@ SELECT
, EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day
, EXTRACT(dayofweek FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow
, EXTRACT(dayofyear FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy
, id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day
, DATE_TRUNC(id_verifications_src_10003.ds_partitioned, day) AS verification__ds_partitioned__day
, DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS verification__ds_partitioned__week
, DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS verification__ds_partitioned__month
, DATE_TRUNC(id_verifications_src_10003.ds_partitioned, quarter) AS verification__ds_partitioned__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Read Elements From Semantic Model 'users_latest'
SELECT
users_latest_src_10008.ds AS ds_latest__day
DATE_TRUNC(users_latest_src_10008.ds, day) AS ds_latest__day
, DATE_TRUNC(users_latest_src_10008.ds, isoweek) AS ds_latest__week
, DATE_TRUNC(users_latest_src_10008.ds, month) AS ds_latest__month
, DATE_TRUNC(users_latest_src_10008.ds, quarter) AS ds_latest__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(dayofweek FROM users_latest_src_10008.ds) AS ds_latest__extract_dow
, EXTRACT(dayofyear FROM users_latest_src_10008.ds) AS ds_latest__extract_doy
, users_latest_src_10008.home_state_latest
, users_latest_src_10008.ds AS user__ds_latest__day
, DATE_TRUNC(users_latest_src_10008.ds, day) AS user__ds_latest__day
, DATE_TRUNC(users_latest_src_10008.ds, isoweek) AS user__ds_latest__week
, DATE_TRUNC(users_latest_src_10008.ds, month) AS user__ds_latest__month
, DATE_TRUNC(users_latest_src_10008.ds, quarter) AS user__ds_latest__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Read Elements From Semantic Model 'revenue'
SELECT
revenue_src_10006.revenue AS txn_revenue
, revenue_src_10006.created_at AS ds__day
, DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day
, DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week
, DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month
, DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day
, EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow
, EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy
, revenue_src_10006.created_at AS company__ds__day
, DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day
, DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week
, DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month
, DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Read Elements From Semantic Model 'id_verifications'
SELECT
1 AS identity_verifications
, id_verifications_src_10003.ds AS ds__day
, DATE_TRUNC('day', id_verifications_src_10003.ds) AS ds__day
, DATE_TRUNC('week', id_verifications_src_10003.ds) AS ds__week
, DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day
, EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow
, EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy
, id_verifications_src_10003.ds_partitioned AS ds_partitioned__day
, DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__day
, DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week
, DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter
Expand All @@ -26,7 +26,7 @@ SELECT
, EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow
, EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy
, id_verifications_src_10003.verification_type
, id_verifications_src_10003.ds AS verification__ds__day
, DATE_TRUNC('day', id_verifications_src_10003.ds) AS verification__ds__day
, DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week
, DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter
Expand All @@ -38,7 +38,7 @@ SELECT
, EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day
, EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow
, EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy
, id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day
, DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__day
, DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week
, DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Read Elements From Semantic Model 'users_latest'
SELECT
users_latest_src_10008.ds AS ds_latest__day
DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day
, DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week
, DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month
, DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(dow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow
, EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy
, users_latest_src_10008.home_state_latest
, users_latest_src_10008.ds AS user__ds_latest__day
, DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day
, DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week
, DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month
, DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Read Elements From Semantic Model 'revenue'
SELECT
revenue_src_10006.revenue AS txn_revenue
, revenue_src_10006.created_at AS ds__day
, DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day
, DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week
, DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month
, DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day
, EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow
, EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy
, revenue_src_10006.created_at AS company__ds__day
, DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day
, DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week
, DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month
, DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Read Elements From Semantic Model 'id_verifications'
SELECT
1 AS identity_verifications
, id_verifications_src_10003.ds AS ds__day
, DATE_TRUNC('day', id_verifications_src_10003.ds) AS ds__day
, DATE_TRUNC('week', id_verifications_src_10003.ds) AS ds__week
, DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day
, EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow
, EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy
, id_verifications_src_10003.ds_partitioned AS ds_partitioned__day
, DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__day
, DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week
, DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter
Expand All @@ -26,7 +26,7 @@ SELECT
, EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow
, EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy
, id_verifications_src_10003.verification_type
, id_verifications_src_10003.ds AS verification__ds__day
, DATE_TRUNC('day', id_verifications_src_10003.ds) AS verification__ds__day
, DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week
, DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter
Expand All @@ -38,7 +38,7 @@ SELECT
, EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day
, EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow
, EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy
, id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day
, DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__day
, DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week
, DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Read Elements From Semantic Model 'users_latest'
SELECT
users_latest_src_10008.ds AS ds_latest__day
DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day
, DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week
, DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month
, DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(dow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow
, EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy
, users_latest_src_10008.home_state_latest
, users_latest_src_10008.ds AS user__ds_latest__day
, DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day
, DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week
, DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month
, DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Read Elements From Semantic Model 'revenue'
SELECT
revenue_src_10006.revenue AS txn_revenue
, revenue_src_10006.created_at AS ds__day
, DATE_TRUNC('day', revenue_src_10006.created_at) AS ds__day
, DATE_TRUNC('week', revenue_src_10006.created_at) AS ds__week
, DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month
, DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day
, EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow
, EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy
, revenue_src_10006.created_at AS company__ds__day
, DATE_TRUNC('day', revenue_src_10006.created_at) AS company__ds__day
, DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week
, DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month
, DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Read Elements From Semantic Model 'id_verifications'
SELECT
1 AS identity_verifications
, id_verifications_src_10003.ds AS ds__day
, DATE_TRUNC('day', id_verifications_src_10003.ds) AS ds__day
, DATE_TRUNC('week', id_verifications_src_10003.ds) AS ds__week
, DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day
, EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow
, EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy
, id_verifications_src_10003.ds_partitioned AS ds_partitioned__day
, DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__day
, DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week
, DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter
Expand All @@ -26,7 +26,7 @@ SELECT
, EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow
, EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy
, id_verifications_src_10003.verification_type
, id_verifications_src_10003.ds AS verification__ds__day
, DATE_TRUNC('day', id_verifications_src_10003.ds) AS verification__ds__day
, DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week
, DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter
Expand All @@ -38,7 +38,7 @@ SELECT
, EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day
, EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow
, EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy
, id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day
, DATE_TRUNC('day', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__day
, DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week
, DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month
, DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Read Elements From Semantic Model 'users_latest'
SELECT
users_latest_src_10008.ds AS ds_latest__day
DATE_TRUNC('day', users_latest_src_10008.ds) AS ds_latest__day
, DATE_TRUNC('week', users_latest_src_10008.ds) AS ds_latest__week
, DATE_TRUNC('month', users_latest_src_10008.ds) AS ds_latest__month
, DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds_latest__quarter
Expand All @@ -13,7 +13,7 @@ SELECT
, EXTRACT(dow FROM users_latest_src_10008.ds) AS ds_latest__extract_dow
, EXTRACT(doy FROM users_latest_src_10008.ds) AS ds_latest__extract_doy
, users_latest_src_10008.home_state_latest
, users_latest_src_10008.ds AS user__ds_latest__day
, DATE_TRUNC('day', users_latest_src_10008.ds) AS user__ds_latest__day
, DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds_latest__week
, DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds_latest__month
, DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds_latest__quarter
Expand Down
Loading

0 comments on commit 21b03b7

Please sign in to comment.