From d4c548215ddd376566de4b35b85dca1bd2b9da8a Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Thu, 21 Nov 2024 07:09:14 -0800 Subject: [PATCH] Update snapshots for other SQL engines --- ..._metric_with_non_default_grains__plan0.sql | 24 ++++---- ...th_non_default_grains__plan0_optimized.sql | 20 +++---- ..._metric_with_non_default_grains__plan0.sql | 24 ++++---- ...th_non_default_grains__plan0_optimized.sql | 20 +++---- ..._metric_with_non_default_grains__plan0.sql | 24 ++++---- ...th_non_default_grains__plan0_optimized.sql | 20 +++---- ..._metric_with_non_default_grains__plan0.sql | 24 ++++---- ...th_non_default_grains__plan0_optimized.sql | 20 +++---- ..._metric_with_non_default_grains__plan0.sql | 24 ++++---- ...th_non_default_grains__plan0_optimized.sql | 20 +++---- ..._metric_with_non_default_grains__plan0.sql | 24 ++++---- ...th_non_default_grains__plan0_optimized.sql | 20 +++---- ..._metric_with_custom_granularity__plan0.sql | 20 +++---- ...nularity_filter_not_in_group_by__plan0.sql | 40 ++++++------- ..._metric_with_custom_granularity__plan0.sql | 20 +++---- ...nularity_filter_not_in_group_by__plan0.sql | 40 ++++++------- ..._metric_with_custom_granularity__plan0.sql | 20 +++---- ...nularity_filter_not_in_group_by__plan0.sql | 40 ++++++------- ..._metric_with_custom_granularity__plan0.sql | 20 +++---- ...nularity_filter_not_in_group_by__plan0.sql | 40 ++++++------- ..._metric_with_custom_granularity__plan0.sql | 20 +++---- ...nularity_filter_not_in_group_by__plan0.sql | 40 ++++++------- ..._metric_with_custom_granularity__plan0.sql | 20 +++---- ...nularity_filter_not_in_group_by__plan0.sql | 40 ++++++------- ...set_metric_with_time_constraint__plan0.sql | 40 ++++++------- ...nth_dimension_and_offset_window__plan0.sql | 10 ++-- ...ved_metric_with_offset_to_grain__plan0.sql | 20 +++---- ...offset_to_grain_and_granularity__plan0.sql | 22 +++---- ...rived_metric_with_offset_window__plan0.sql | 20 +++---- ...h_offset_window_and_granularity__plan0.sql | 22 +++---- ...fset_window_and_offset_to_grain__plan0.sql | 40 ++++++------- ...offset_to_grain_and_granularity__plan0.sql | 44 +++++++------- ...h_offset_window_and_time_filter__plan0.sql | 40 ++++++------- ...erived_offset_cumulative_metric__plan0.sql | 20 +++---- ...offset_metric_with_agg_time_dim__plan0.sql | 20 +++---- ...et_metric_with_one_input_metric__plan0.sql | 20 +++---- ...d_where_constraint_not_selected__plan0.sql | 20 +++---- .../BigQuery/test_nested_offsets__plan0.sql | 20 +++---- ...ed_offsets_with_time_constraint__plan0.sql | 20 +++---- ...d_offsets_with_where_constraint__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...n_metric_multiple_granularities__plan0.sql | 16 ++--- ...fset_to_grain_with_agg_time_dim__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...w_metric_multiple_granularities__plan0.sql | 16 ++--- ...offset_window_with_agg_time_dim__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 40 ++++++------- ...nth_dimension_and_offset_window__plan0.sql | 10 ++-- ...ved_metric_with_offset_to_grain__plan0.sql | 20 +++---- ...offset_to_grain_and_granularity__plan0.sql | 22 +++---- ...rived_metric_with_offset_window__plan0.sql | 20 +++---- ...h_offset_window_and_granularity__plan0.sql | 22 +++---- ...fset_window_and_offset_to_grain__plan0.sql | 40 ++++++------- ...offset_to_grain_and_granularity__plan0.sql | 44 +++++++------- ...h_offset_window_and_time_filter__plan0.sql | 40 ++++++------- ...erived_offset_cumulative_metric__plan0.sql | 20 +++---- ...offset_metric_with_agg_time_dim__plan0.sql | 20 +++---- ...et_metric_with_one_input_metric__plan0.sql | 20 +++---- ...d_where_constraint_not_selected__plan0.sql | 20 +++---- .../Databricks/test_nested_offsets__plan0.sql | 20 +++---- ...ed_offsets_with_time_constraint__plan0.sql | 20 +++---- ...d_offsets_with_where_constraint__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...n_metric_multiple_granularities__plan0.sql | 16 ++--- ...fset_to_grain_with_agg_time_dim__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...w_metric_multiple_granularities__plan0.sql | 16 ++--- ...offset_window_with_agg_time_dim__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 40 ++++++------- ...nth_dimension_and_offset_window__plan0.sql | 10 ++-- ...ved_metric_with_offset_to_grain__plan0.sql | 20 +++---- ...offset_to_grain_and_granularity__plan0.sql | 22 +++---- ...rived_metric_with_offset_window__plan0.sql | 20 +++---- ...h_offset_window_and_granularity__plan0.sql | 22 +++---- ...fset_window_and_offset_to_grain__plan0.sql | 40 ++++++------- ...offset_to_grain_and_granularity__plan0.sql | 44 +++++++------- ...h_offset_window_and_time_filter__plan0.sql | 40 ++++++------- ...erived_offset_cumulative_metric__plan0.sql | 20 +++---- ...offset_metric_with_agg_time_dim__plan0.sql | 20 +++---- ...et_metric_with_one_input_metric__plan0.sql | 20 +++---- ...d_where_constraint_not_selected__plan0.sql | 20 +++---- .../Postgres/test_nested_offsets__plan0.sql | 20 +++---- ...ed_offsets_with_time_constraint__plan0.sql | 20 +++---- ...d_offsets_with_where_constraint__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...n_metric_multiple_granularities__plan0.sql | 16 ++--- ...fset_to_grain_with_agg_time_dim__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...w_metric_multiple_granularities__plan0.sql | 16 ++--- ...offset_window_with_agg_time_dim__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 40 ++++++------- ...nth_dimension_and_offset_window__plan0.sql | 10 ++-- ...ved_metric_with_offset_to_grain__plan0.sql | 20 +++---- ...offset_to_grain_and_granularity__plan0.sql | 22 +++---- ...rived_metric_with_offset_window__plan0.sql | 20 +++---- ...h_offset_window_and_granularity__plan0.sql | 22 +++---- ...fset_window_and_offset_to_grain__plan0.sql | 40 ++++++------- ...offset_to_grain_and_granularity__plan0.sql | 44 +++++++------- ...h_offset_window_and_time_filter__plan0.sql | 40 ++++++------- ...erived_offset_cumulative_metric__plan0.sql | 20 +++---- ...offset_metric_with_agg_time_dim__plan0.sql | 20 +++---- ...et_metric_with_one_input_metric__plan0.sql | 20 +++---- ...d_where_constraint_not_selected__plan0.sql | 20 +++---- .../Redshift/test_nested_offsets__plan0.sql | 20 +++---- ...ed_offsets_with_time_constraint__plan0.sql | 20 +++---- ...d_offsets_with_where_constraint__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...n_metric_multiple_granularities__plan0.sql | 16 ++--- ...fset_to_grain_with_agg_time_dim__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...w_metric_multiple_granularities__plan0.sql | 16 ++--- ...offset_window_with_agg_time_dim__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 40 ++++++------- ...nth_dimension_and_offset_window__plan0.sql | 10 ++-- ...ved_metric_with_offset_to_grain__plan0.sql | 20 +++---- ...offset_to_grain_and_granularity__plan0.sql | 22 +++---- ...rived_metric_with_offset_window__plan0.sql | 20 +++---- ...h_offset_window_and_granularity__plan0.sql | 22 +++---- ...fset_window_and_offset_to_grain__plan0.sql | 40 ++++++------- ...offset_to_grain_and_granularity__plan0.sql | 44 +++++++------- ...h_offset_window_and_time_filter__plan0.sql | 40 ++++++------- ...erived_offset_cumulative_metric__plan0.sql | 20 +++---- ...offset_metric_with_agg_time_dim__plan0.sql | 20 +++---- ...et_metric_with_one_input_metric__plan0.sql | 20 +++---- ...d_where_constraint_not_selected__plan0.sql | 20 +++---- .../Snowflake/test_nested_offsets__plan0.sql | 20 +++---- ...ed_offsets_with_time_constraint__plan0.sql | 20 +++---- ...d_offsets_with_where_constraint__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...n_metric_multiple_granularities__plan0.sql | 16 ++--- ...fset_to_grain_with_agg_time_dim__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...w_metric_multiple_granularities__plan0.sql | 16 ++--- ...offset_window_with_agg_time_dim__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 40 ++++++------- ...nth_dimension_and_offset_window__plan0.sql | 10 ++-- ...ved_metric_with_offset_to_grain__plan0.sql | 20 +++---- ...offset_to_grain_and_granularity__plan0.sql | 22 +++---- ...rived_metric_with_offset_window__plan0.sql | 20 +++---- ...h_offset_window_and_granularity__plan0.sql | 22 +++---- ...fset_window_and_offset_to_grain__plan0.sql | 40 ++++++------- ...offset_to_grain_and_granularity__plan0.sql | 44 +++++++------- ...h_offset_window_and_time_filter__plan0.sql | 40 ++++++------- ...erived_offset_cumulative_metric__plan0.sql | 20 +++---- ...offset_metric_with_agg_time_dim__plan0.sql | 20 +++---- ...et_metric_with_one_input_metric__plan0.sql | 20 +++---- ...d_where_constraint_not_selected__plan0.sql | 20 +++---- .../Trino/test_nested_offsets__plan0.sql | 20 +++---- ...ed_offsets_with_time_constraint__plan0.sql | 20 +++---- ...d_offsets_with_where_constraint__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...n_metric_multiple_granularities__plan0.sql | 16 ++--- ...fset_to_grain_with_agg_time_dim__plan0.sql | 20 +++---- ...ry_have_different_granularities__plan0.sql | 44 +++++++------- ...fferent_granularities__plan0_optimized.sql | 4 +- ...w_metric_multiple_granularities__plan0.sql | 16 ++--- ...offset_window_with_agg_time_dim__plan0.sql | 20 +++---- ...set_metric_with_time_constraint__plan0.sql | 20 +++---- ...fill_nulls_for_one_input_metric__plan0.sql | 20 +++---- ...fill_nulls_for_one_input_metric__plan0.sql | 20 +++---- ...fill_nulls_for_one_input_metric__plan0.sql | 20 +++---- ...fill_nulls_for_one_input_metric__plan0.sql | 20 +++---- ...fill_nulls_for_one_input_metric__plan0.sql | 20 +++---- ...fill_nulls_for_one_input_metric__plan0.sql | 20 +++---- ...st_offset_window_with_date_part__plan0.sql | 22 +++---- ...subdaily_offset_to_grain_metric__plan0.sql | 22 +++---- ...t_subdaily_offset_window_metric__plan0.sql | 22 +++---- ...st_offset_window_with_date_part__plan0.sql | 22 +++---- ...subdaily_offset_to_grain_metric__plan0.sql | 22 +++---- ...t_subdaily_offset_window_metric__plan0.sql | 22 +++---- ...st_offset_window_with_date_part__plan0.sql | 22 +++---- ...subdaily_offset_to_grain_metric__plan0.sql | 22 +++---- ...t_subdaily_offset_window_metric__plan0.sql | 22 +++---- ...st_offset_window_with_date_part__plan0.sql | 22 +++---- ...subdaily_offset_to_grain_metric__plan0.sql | 22 +++---- ...t_subdaily_offset_window_metric__plan0.sql | 22 +++---- ...st_offset_window_with_date_part__plan0.sql | 22 +++---- ...subdaily_offset_to_grain_metric__plan0.sql | 22 +++---- ...t_subdaily_offset_window_metric__plan0.sql | 22 +++---- ...st_offset_window_with_date_part__plan0.sql | 22 +++---- ...subdaily_offset_to_grain_metric__plan0.sql | 22 +++---- ...t_subdaily_offset_window_metric__plan0.sql | 22 +++---- ...spine_metric_predicate_pushdown__plan0.sql | 60 +++++++++---------- ..._metric_with_query_time_filters__plan0.sql | 60 +++++++++---------- ...spine_metric_predicate_pushdown__plan0.sql | 60 +++++++++---------- ..._metric_with_query_time_filters__plan0.sql | 60 +++++++++---------- ...spine_metric_predicate_pushdown__plan0.sql | 60 +++++++++---------- ..._metric_with_query_time_filters__plan0.sql | 60 +++++++++---------- ...spine_metric_predicate_pushdown__plan0.sql | 60 +++++++++---------- ..._metric_with_query_time_filters__plan0.sql | 60 +++++++++---------- ...spine_metric_predicate_pushdown__plan0.sql | 60 +++++++++---------- ..._metric_with_query_time_filters__plan0.sql | 60 +++++++++---------- ...spine_metric_predicate_pushdown__plan0.sql | 60 +++++++++---------- ..._metric_with_query_time_filters__plan0.sql | 60 +++++++++---------- 210 files changed, 2688 insertions(+), 2688 deletions(-) diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_window_metric_with_non_default_grains__plan0.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_window_metric_with_non_default_grains__plan0.sql index d8ffb1b0b..983896334 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_window_metric_with_non_default_grains__plan0.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_window_metric_with_non_default_grains__plan0.sql @@ -8,34 +8,34 @@ sql_engine: BigQuery --- -- Re-aggregate Metric via Group By SELECT - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 FROM ( -- Window Function for Metric Re-aggregation SELECT - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week , FIRST_VALUE(subq_10.every_two_days_bookers_fill_nulls_with_0) OVER ( PARTITION BY - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week ORDER BY subq_10.metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions SELECT - subq_9.metric_time__day + subq_9.booking__ds__month + , subq_9.metric_time__day , subq_9.metric_time__week - , subq_9.booking__ds__month , COALESCE(subq_9.bookers, 0) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day + DATETIME_TRUNC(subq_7.metric_time__day, month) AS booking__ds__month + , subq_7.metric_time__day AS metric_time__day , DATETIME_TRUNC(subq_7.metric_time__day, isoweek) AS metric_time__week - , subq_6.booking__ds__month AS booking__ds__month , subq_6.bookers AS bookers FROM ( -- Time Spine @@ -380,6 +380,6 @@ FROM ( ) subq_10 ) subq_11 GROUP BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_window_metric_with_non_default_grains__plan0_optimized.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_window_metric_with_non_default_grains__plan0_optimized.sql index c0ca6dd62..76197cdbc 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_window_metric_with_non_default_grains__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/BigQuery/test_window_metric_with_non_default_grains__plan0_optimized.sql @@ -8,28 +8,28 @@ sql_engine: BigQuery --- -- Re-aggregate Metric via Group By SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions -- Window Function for Metric Re-aggregation SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , FIRST_VALUE(COALESCE(bookers, 0)) OVER ( PARTITION BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week ORDER BY metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_20.ds AS metric_time__day + DATETIME_TRUNC(subq_20.ds, month) AS booking__ds__month + , subq_20.ds AS metric_time__day , DATETIME_TRUNC(subq_20.ds, isoweek) AS metric_time__week - , subq_18.booking__ds__month AS booking__ds__month , subq_18.bookers AS bookers FROM ***************************.mf_time_spine subq_20 LEFT OUTER JOIN ( @@ -60,6 +60,6 @@ FROM ( ) subq_21 ) subq_23 GROUP BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_window_metric_with_non_default_grains__plan0.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_window_metric_with_non_default_grains__plan0.sql index a06996713..6c8eaceb9 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_window_metric_with_non_default_grains__plan0.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_window_metric_with_non_default_grains__plan0.sql @@ -8,34 +8,34 @@ sql_engine: Databricks --- -- Re-aggregate Metric via Group By SELECT - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 FROM ( -- Window Function for Metric Re-aggregation SELECT - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week , FIRST_VALUE(subq_10.every_two_days_bookers_fill_nulls_with_0) OVER ( PARTITION BY - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week ORDER BY subq_10.metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions SELECT - subq_9.metric_time__day + subq_9.booking__ds__month + , subq_9.metric_time__day , subq_9.metric_time__week - , subq_9.booking__ds__month , COALESCE(subq_9.bookers, 0) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day + DATE_TRUNC('month', subq_7.metric_time__day) AS booking__ds__month + , subq_7.metric_time__day AS metric_time__day , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , subq_6.booking__ds__month AS booking__ds__month , subq_6.bookers AS bookers FROM ( -- Time Spine @@ -380,6 +380,6 @@ FROM ( ) subq_10 ) subq_11 GROUP BY - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_window_metric_with_non_default_grains__plan0_optimized.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_window_metric_with_non_default_grains__plan0_optimized.sql index 8781e118b..4a16253b6 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_window_metric_with_non_default_grains__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Databricks/test_window_metric_with_non_default_grains__plan0_optimized.sql @@ -8,28 +8,28 @@ sql_engine: Databricks --- -- Re-aggregate Metric via Group By SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions -- Window Function for Metric Re-aggregation SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , FIRST_VALUE(COALESCE(bookers, 0)) OVER ( PARTITION BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week ORDER BY metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_20.ds AS metric_time__day + DATE_TRUNC('month', subq_20.ds) AS booking__ds__month + , subq_20.ds AS metric_time__day , DATE_TRUNC('week', subq_20.ds) AS metric_time__week - , subq_18.booking__ds__month AS booking__ds__month , subq_18.bookers AS bookers FROM ***************************.mf_time_spine subq_20 LEFT OUTER JOIN ( @@ -60,6 +60,6 @@ FROM ( ) subq_21 ) subq_23 GROUP BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_window_metric_with_non_default_grains__plan0.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_window_metric_with_non_default_grains__plan0.sql index 440e5837e..e1cf8da44 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_window_metric_with_non_default_grains__plan0.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_window_metric_with_non_default_grains__plan0.sql @@ -8,34 +8,34 @@ sql_engine: Postgres --- -- Re-aggregate Metric via Group By SELECT - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 FROM ( -- Window Function for Metric Re-aggregation SELECT - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week , FIRST_VALUE(subq_10.every_two_days_bookers_fill_nulls_with_0) OVER ( PARTITION BY - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week ORDER BY subq_10.metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions SELECT - subq_9.metric_time__day + subq_9.booking__ds__month + , subq_9.metric_time__day , subq_9.metric_time__week - , subq_9.booking__ds__month , COALESCE(subq_9.bookers, 0) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day + DATE_TRUNC('month', subq_7.metric_time__day) AS booking__ds__month + , subq_7.metric_time__day AS metric_time__day , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , subq_6.booking__ds__month AS booking__ds__month , subq_6.bookers AS bookers FROM ( -- Time Spine @@ -380,6 +380,6 @@ FROM ( ) subq_10 ) subq_11 GROUP BY - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_window_metric_with_non_default_grains__plan0_optimized.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_window_metric_with_non_default_grains__plan0_optimized.sql index 08450420e..417844f92 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_window_metric_with_non_default_grains__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Postgres/test_window_metric_with_non_default_grains__plan0_optimized.sql @@ -8,28 +8,28 @@ sql_engine: Postgres --- -- Re-aggregate Metric via Group By SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions -- Window Function for Metric Re-aggregation SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , FIRST_VALUE(COALESCE(bookers, 0)) OVER ( PARTITION BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week ORDER BY metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_20.ds AS metric_time__day + DATE_TRUNC('month', subq_20.ds) AS booking__ds__month + , subq_20.ds AS metric_time__day , DATE_TRUNC('week', subq_20.ds) AS metric_time__week - , subq_18.booking__ds__month AS booking__ds__month , subq_18.bookers AS bookers FROM ***************************.mf_time_spine subq_20 LEFT OUTER JOIN ( @@ -60,6 +60,6 @@ FROM ( ) subq_21 ) subq_23 GROUP BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_window_metric_with_non_default_grains__plan0.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_window_metric_with_non_default_grains__plan0.sql index a94d9c967..920c847ed 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_window_metric_with_non_default_grains__plan0.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_window_metric_with_non_default_grains__plan0.sql @@ -8,34 +8,34 @@ sql_engine: Redshift --- -- Re-aggregate Metric via Group By SELECT - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 FROM ( -- Window Function for Metric Re-aggregation SELECT - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week , FIRST_VALUE(subq_10.every_two_days_bookers_fill_nulls_with_0) OVER ( PARTITION BY - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week ORDER BY subq_10.metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions SELECT - subq_9.metric_time__day + subq_9.booking__ds__month + , subq_9.metric_time__day , subq_9.metric_time__week - , subq_9.booking__ds__month , COALESCE(subq_9.bookers, 0) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day + DATE_TRUNC('month', subq_7.metric_time__day) AS booking__ds__month + , subq_7.metric_time__day AS metric_time__day , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , subq_6.booking__ds__month AS booking__ds__month , subq_6.bookers AS bookers FROM ( -- Time Spine @@ -380,6 +380,6 @@ FROM ( ) subq_10 ) subq_11 GROUP BY - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_window_metric_with_non_default_grains__plan0_optimized.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_window_metric_with_non_default_grains__plan0_optimized.sql index faffe28b1..5d172a21a 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_window_metric_with_non_default_grains__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Redshift/test_window_metric_with_non_default_grains__plan0_optimized.sql @@ -8,28 +8,28 @@ sql_engine: Redshift --- -- Re-aggregate Metric via Group By SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions -- Window Function for Metric Re-aggregation SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , FIRST_VALUE(COALESCE(bookers, 0)) OVER ( PARTITION BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week ORDER BY metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_20.ds AS metric_time__day + DATE_TRUNC('month', subq_20.ds) AS booking__ds__month + , subq_20.ds AS metric_time__day , DATE_TRUNC('week', subq_20.ds) AS metric_time__week - , subq_18.booking__ds__month AS booking__ds__month , subq_18.bookers AS bookers FROM ***************************.mf_time_spine subq_20 LEFT OUTER JOIN ( @@ -60,6 +60,6 @@ FROM ( ) subq_21 ) subq_23 GROUP BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_window_metric_with_non_default_grains__plan0.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_window_metric_with_non_default_grains__plan0.sql index f07cc9121..9cdae4011 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_window_metric_with_non_default_grains__plan0.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_window_metric_with_non_default_grains__plan0.sql @@ -8,34 +8,34 @@ sql_engine: Snowflake --- -- Re-aggregate Metric via Group By SELECT - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 FROM ( -- Window Function for Metric Re-aggregation SELECT - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week , FIRST_VALUE(subq_10.every_two_days_bookers_fill_nulls_with_0) OVER ( PARTITION BY - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week ORDER BY subq_10.metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions SELECT - subq_9.metric_time__day + subq_9.booking__ds__month + , subq_9.metric_time__day , subq_9.metric_time__week - , subq_9.booking__ds__month , COALESCE(subq_9.bookers, 0) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day + DATE_TRUNC('month', subq_7.metric_time__day) AS booking__ds__month + , subq_7.metric_time__day AS metric_time__day , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , subq_6.booking__ds__month AS booking__ds__month , subq_6.bookers AS bookers FROM ( -- Time Spine @@ -380,6 +380,6 @@ FROM ( ) subq_10 ) subq_11 GROUP BY - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_window_metric_with_non_default_grains__plan0_optimized.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_window_metric_with_non_default_grains__plan0_optimized.sql index a8be656ab..d98ee20cf 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_window_metric_with_non_default_grains__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Snowflake/test_window_metric_with_non_default_grains__plan0_optimized.sql @@ -8,28 +8,28 @@ sql_engine: Snowflake --- -- Re-aggregate Metric via Group By SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions -- Window Function for Metric Re-aggregation SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , FIRST_VALUE(COALESCE(bookers, 0)) OVER ( PARTITION BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week ORDER BY metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_20.ds AS metric_time__day + DATE_TRUNC('month', subq_20.ds) AS booking__ds__month + , subq_20.ds AS metric_time__day , DATE_TRUNC('week', subq_20.ds) AS metric_time__week - , subq_18.booking__ds__month AS booking__ds__month , subq_18.bookers AS bookers FROM ***************************.mf_time_spine subq_20 LEFT OUTER JOIN ( @@ -60,6 +60,6 @@ FROM ( ) subq_21 ) subq_23 GROUP BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_window_metric_with_non_default_grains__plan0.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_window_metric_with_non_default_grains__plan0.sql index 5a85b8a6d..440b3e427 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_window_metric_with_non_default_grains__plan0.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_window_metric_with_non_default_grains__plan0.sql @@ -8,34 +8,34 @@ sql_engine: Trino --- -- Re-aggregate Metric via Group By SELECT - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 FROM ( -- Window Function for Metric Re-aggregation SELECT - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week , FIRST_VALUE(subq_10.every_two_days_bookers_fill_nulls_with_0) OVER ( PARTITION BY - subq_10.metric_time__week - , subq_10.booking__ds__month + subq_10.booking__ds__month + , subq_10.metric_time__week ORDER BY subq_10.metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions SELECT - subq_9.metric_time__day + subq_9.booking__ds__month + , subq_9.metric_time__day , subq_9.metric_time__week - , subq_9.booking__ds__month , COALESCE(subq_9.bookers, 0) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day + DATE_TRUNC('month', subq_7.metric_time__day) AS booking__ds__month + , subq_7.metric_time__day AS metric_time__day , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , subq_6.booking__ds__month AS booking__ds__month , subq_6.bookers AS bookers FROM ( -- Time Spine @@ -380,6 +380,6 @@ FROM ( ) subq_10 ) subq_11 GROUP BY - subq_11.metric_time__week - , subq_11.booking__ds__month + subq_11.booking__ds__month + , subq_11.metric_time__week , subq_11.every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_window_metric_with_non_default_grains__plan0_optimized.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_window_metric_with_non_default_grains__plan0_optimized.sql index 2787373c0..aa9a15b72 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_window_metric_with_non_default_grains__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/Trino/test_window_metric_with_non_default_grains__plan0_optimized.sql @@ -8,28 +8,28 @@ sql_engine: Trino --- -- Re-aggregate Metric via Group By SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 FROM ( -- Compute Metrics via Expressions -- Window Function for Metric Re-aggregation SELECT - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , FIRST_VALUE(COALESCE(bookers, 0)) OVER ( PARTITION BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week ORDER BY metric_time__day ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) AS every_two_days_bookers_fill_nulls_with_0 FROM ( -- Join to Time Spine Dataset SELECT - subq_20.ds AS metric_time__day + DATE_TRUNC('month', subq_20.ds) AS booking__ds__month + , subq_20.ds AS metric_time__day , DATE_TRUNC('week', subq_20.ds) AS metric_time__week - , subq_18.booking__ds__month AS booking__ds__month , subq_18.bookers AS bookers FROM ***************************.mf_time_spine subq_20 LEFT OUTER JOIN ( @@ -60,6 +60,6 @@ FROM ( ) subq_21 ) subq_23 GROUP BY - metric_time__week - , booking__ds__month + booking__ds__month + , metric_time__week , every_two_days_bookers_fill_nulls_with_0 diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/BigQuery/test_offset_metric_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/BigQuery/test_offset_metric_with_custom_granularity__plan0.sql index 944c04ae2..6f44b7dd3 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/BigQuery/test_offset_metric_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/BigQuery/test_offset_metric_with_custom_granularity__plan0.sql @@ -26,16 +26,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATETIME_TRUNC(subq_2.booking__ds__day, isoweek) AS booking__ds__week - , DATETIME_TRUNC(subq_2.booking__ds__day, month) AS booking__ds__month - , DATETIME_TRUNC(subq_2.booking__ds__day, quarter) AS booking__ds__quarter - , DATETIME_TRUNC(subq_2.booking__ds__day, year) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.booking__ds__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.booking__ds__day) - 1) AS booking__ds__extract_dow - , EXTRACT(dayofyear FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -69,6 +59,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/BigQuery/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/BigQuery/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql index c0581a4f2..28c4d122e 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/BigQuery/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/BigQuery/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql @@ -26,16 +26,6 @@ FROM ( SELECT subq_5.metric_time__martian_day , subq_5.metric_time__day - , subq_5.metric_time__week - , subq_5.metric_time__month - , subq_5.metric_time__quarter - , subq_5.metric_time__year - , subq_5.metric_time__extract_year - , subq_5.metric_time__extract_quarter - , subq_5.metric_time__extract_month - , subq_5.metric_time__extract_day - , subq_5.metric_time__extract_dow - , subq_5.metric_time__extract_doy , subq_5.ds__day , subq_5.ds__week , subq_5.ds__month @@ -102,6 +92,16 @@ FROM ( , subq_5.booking__paid_at__extract_day , subq_5.booking__paid_at__extract_dow , subq_5.booking__paid_at__extract_doy + , subq_5.metric_time__week + , subq_5.metric_time__month + , subq_5.metric_time__quarter + , subq_5.metric_time__year + , subq_5.metric_time__extract_year + , subq_5.metric_time__extract_quarter + , subq_5.metric_time__extract_month + , subq_5.metric_time__extract_day + , subq_5.metric_time__extract_dow + , subq_5.metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -128,16 +128,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Databricks/test_offset_metric_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Databricks/test_offset_metric_with_custom_granularity__plan0.sql index 21cbbc82f..7d623cb6e 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Databricks/test_offset_metric_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Databricks/test_offset_metric_with_custom_granularity__plan0.sql @@ -26,16 +26,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_2.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_2.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_2.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_2.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -69,6 +59,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Databricks/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Databricks/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql index 672b0c3c3..ac0ae630e 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Databricks/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Databricks/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql @@ -26,16 +26,6 @@ FROM ( SELECT subq_5.metric_time__martian_day , subq_5.metric_time__day - , subq_5.metric_time__week - , subq_5.metric_time__month - , subq_5.metric_time__quarter - , subq_5.metric_time__year - , subq_5.metric_time__extract_year - , subq_5.metric_time__extract_quarter - , subq_5.metric_time__extract_month - , subq_5.metric_time__extract_day - , subq_5.metric_time__extract_dow - , subq_5.metric_time__extract_doy , subq_5.ds__day , subq_5.ds__week , subq_5.ds__month @@ -102,6 +92,16 @@ FROM ( , subq_5.booking__paid_at__extract_day , subq_5.booking__paid_at__extract_dow , subq_5.booking__paid_at__extract_doy + , subq_5.metric_time__week + , subq_5.metric_time__month + , subq_5.metric_time__quarter + , subq_5.metric_time__year + , subq_5.metric_time__extract_year + , subq_5.metric_time__extract_quarter + , subq_5.metric_time__extract_month + , subq_5.metric_time__extract_day + , subq_5.metric_time__extract_dow + , subq_5.metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -128,16 +128,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Postgres/test_offset_metric_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Postgres/test_offset_metric_with_custom_granularity__plan0.sql index 5b948cbb8..e1141a251 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Postgres/test_offset_metric_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Postgres/test_offset_metric_with_custom_granularity__plan0.sql @@ -26,16 +26,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_2.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_2.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_2.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_2.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(isodow FROM subq_2.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -69,6 +59,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Postgres/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Postgres/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql index 34f0c3329..8f4617d28 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Postgres/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Postgres/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql @@ -26,16 +26,6 @@ FROM ( SELECT subq_5.metric_time__martian_day , subq_5.metric_time__day - , subq_5.metric_time__week - , subq_5.metric_time__month - , subq_5.metric_time__quarter - , subq_5.metric_time__year - , subq_5.metric_time__extract_year - , subq_5.metric_time__extract_quarter - , subq_5.metric_time__extract_month - , subq_5.metric_time__extract_day - , subq_5.metric_time__extract_dow - , subq_5.metric_time__extract_doy , subq_5.ds__day , subq_5.ds__week , subq_5.ds__month @@ -102,6 +92,16 @@ FROM ( , subq_5.booking__paid_at__extract_day , subq_5.booking__paid_at__extract_dow , subq_5.booking__paid_at__extract_doy + , subq_5.metric_time__week + , subq_5.metric_time__month + , subq_5.metric_time__quarter + , subq_5.metric_time__year + , subq_5.metric_time__extract_year + , subq_5.metric_time__extract_quarter + , subq_5.metric_time__extract_month + , subq_5.metric_time__extract_day + , subq_5.metric_time__extract_dow + , subq_5.metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -128,16 +128,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Redshift/test_offset_metric_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Redshift/test_offset_metric_with_custom_granularity__plan0.sql index b3c8a539a..f79cb4c36 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Redshift/test_offset_metric_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Redshift/test_offset_metric_with_custom_granularity__plan0.sql @@ -26,16 +26,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_2.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_2.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_2.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_2.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.booking__ds__day) = 0 THEN EXTRACT(dow FROM subq_2.booking__ds__day) + 7 ELSE EXTRACT(dow FROM subq_2.booking__ds__day) END AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -69,6 +59,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Redshift/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Redshift/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql index 770f90b5c..45f2fbc06 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Redshift/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Redshift/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql @@ -26,16 +26,6 @@ FROM ( SELECT subq_5.metric_time__martian_day , subq_5.metric_time__day - , subq_5.metric_time__week - , subq_5.metric_time__month - , subq_5.metric_time__quarter - , subq_5.metric_time__year - , subq_5.metric_time__extract_year - , subq_5.metric_time__extract_quarter - , subq_5.metric_time__extract_month - , subq_5.metric_time__extract_day - , subq_5.metric_time__extract_dow - , subq_5.metric_time__extract_doy , subq_5.ds__day , subq_5.ds__week , subq_5.ds__month @@ -102,6 +92,16 @@ FROM ( , subq_5.booking__paid_at__extract_day , subq_5.booking__paid_at__extract_dow , subq_5.booking__paid_at__extract_doy + , subq_5.metric_time__week + , subq_5.metric_time__month + , subq_5.metric_time__quarter + , subq_5.metric_time__year + , subq_5.metric_time__extract_year + , subq_5.metric_time__extract_quarter + , subq_5.metric_time__extract_month + , subq_5.metric_time__extract_day + , subq_5.metric_time__extract_dow + , subq_5.metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -128,16 +128,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Snowflake/test_offset_metric_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Snowflake/test_offset_metric_with_custom_granularity__plan0.sql index 2d27633c4..6a98a77a1 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Snowflake/test_offset_metric_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Snowflake/test_offset_metric_with_custom_granularity__plan0.sql @@ -26,16 +26,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_2.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_2.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_2.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_2.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(dayofweekiso FROM subq_2.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -69,6 +59,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Snowflake/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Snowflake/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql index c9b3f8ab3..58a022c87 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Snowflake/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Snowflake/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql @@ -26,16 +26,6 @@ FROM ( SELECT subq_5.metric_time__martian_day , subq_5.metric_time__day - , subq_5.metric_time__week - , subq_5.metric_time__month - , subq_5.metric_time__quarter - , subq_5.metric_time__year - , subq_5.metric_time__extract_year - , subq_5.metric_time__extract_quarter - , subq_5.metric_time__extract_month - , subq_5.metric_time__extract_day - , subq_5.metric_time__extract_dow - , subq_5.metric_time__extract_doy , subq_5.ds__day , subq_5.ds__week , subq_5.ds__month @@ -102,6 +92,16 @@ FROM ( , subq_5.booking__paid_at__extract_day , subq_5.booking__paid_at__extract_dow , subq_5.booking__paid_at__extract_doy + , subq_5.metric_time__week + , subq_5.metric_time__month + , subq_5.metric_time__quarter + , subq_5.metric_time__year + , subq_5.metric_time__extract_year + , subq_5.metric_time__extract_quarter + , subq_5.metric_time__extract_month + , subq_5.metric_time__extract_day + , subq_5.metric_time__extract_dow + , subq_5.metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -128,16 +128,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Trino/test_offset_metric_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Trino/test_offset_metric_with_custom_granularity__plan0.sql index b1acbbb39..c0e42d0d6 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Trino/test_offset_metric_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Trino/test_offset_metric_with_custom_granularity__plan0.sql @@ -26,16 +26,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_2.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_2.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_2.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_2.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -69,6 +59,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Trino/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Trino/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql index fb29efa35..6ddbbbdaf 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Trino/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/Trino/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql @@ -26,16 +26,6 @@ FROM ( SELECT subq_5.metric_time__martian_day , subq_5.metric_time__day - , subq_5.metric_time__week - , subq_5.metric_time__month - , subq_5.metric_time__quarter - , subq_5.metric_time__year - , subq_5.metric_time__extract_year - , subq_5.metric_time__extract_quarter - , subq_5.metric_time__extract_month - , subq_5.metric_time__extract_day - , subq_5.metric_time__extract_dow - , subq_5.metric_time__extract_doy , subq_5.ds__day , subq_5.ds__week , subq_5.ds__month @@ -102,6 +92,16 @@ FROM ( , subq_5.booking__paid_at__extract_day , subq_5.booking__paid_at__extract_dow , subq_5.booking__paid_at__extract_doy + , subq_5.metric_time__week + , subq_5.metric_time__month + , subq_5.metric_time__quarter + , subq_5.metric_time__year + , subq_5.metric_time__extract_year + , subq_5.metric_time__extract_quarter + , subq_5.metric_time__extract_month + , subq_5.metric_time__extract_day + , subq_5.metric_time__extract_dow + , subq_5.metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -128,16 +128,6 @@ FROM ( -- Join to Custom Granularity Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql index 455548480..e28bc9828 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Constrain Time Range to [2019-12-19T00:00:00, 2020-01-02T00:00:00] SELECT subq_7.metric_time__day - , subq_7.metric_time__week - , subq_7.metric_time__month - , subq_7.metric_time__quarter - , subq_7.metric_time__year - , subq_7.metric_time__extract_year - , subq_7.metric_time__extract_quarter - , subq_7.metric_time__extract_month - , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dow - , subq_7.metric_time__extract_doy , subq_7.ds__day , subq_7.ds__week , subq_7.ds__month @@ -101,6 +91,16 @@ FROM ( , subq_7.booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy + , subq_7.metric_time__week + , subq_7.metric_time__month + , subq_7.metric_time__quarter + , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -126,16 +126,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_5.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_5.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_5.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_5.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_5.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_5.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -202,6 +192,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql index 4197903d8..aa69ae70d 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql @@ -25,11 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__month AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__month, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__month, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__month) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__month) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__month) AS metric_time__extract_month , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year @@ -42,6 +37,11 @@ FROM ( , subq_1.booking_monthly__ds__extract_year AS booking_monthly__ds__extract_year , subq_1.booking_monthly__ds__extract_quarter AS booking_monthly__ds__extract_quarter , subq_1.booking_monthly__ds__extract_month AS booking_monthly__ds__extract_month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.listing AS listing , subq_1.booking_monthly__listing AS booking_monthly__listing , subq_1.bookings_monthly AS bookings_monthly diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql index 03cb0c964..766c84131 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_7.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_7.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_7.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_7.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_7.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_7.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index dfea0e70a..f4c27482d 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_7.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_7.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_7.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_7.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_7.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_7.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATETIME_TRUNC(subq_7.metric_time__day, isoweek) AS metric_time__week , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql index ab78f5349..4315352dd 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_7.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_7.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_7.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_7.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_7.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_7.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql index b2418c319..8dab694d7 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_7.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_7.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_7.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_7.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_7.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_7.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATETIME_TRUNC(subq_7.metric_time__day, quarter) AS metric_time__quarter , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index d855e9f1e..e2891b8c7 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,16 +356,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_10.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_10.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_10.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_10.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_10.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_10.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -432,6 +422,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index eb13c7d7c..801310a99 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -30,17 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,17 +356,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_10.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_10.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_10.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_10.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_10.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_10.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_10.metric_time__day) AS metric_time__extract_doy + DATETIME_TRUNC(subq_10.metric_time__day, year) AS metric_time__year , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -433,6 +423,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__day AS metric_time__day + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_time_filter__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_time_filter__plan0.sql index 9b1c01273..381f3d287 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_time_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_time_filter__plan0.sql @@ -349,16 +349,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_10.metric_time__day - , subq_10.metric_time__week - , subq_10.metric_time__month - , subq_10.metric_time__quarter - , subq_10.metric_time__year - , subq_10.metric_time__extract_year - , subq_10.metric_time__extract_quarter - , subq_10.metric_time__extract_month - , subq_10.metric_time__extract_day - , subq_10.metric_time__extract_dow - , subq_10.metric_time__extract_doy , subq_10.ds__day , subq_10.ds__week , subq_10.ds__month @@ -425,6 +415,16 @@ FROM ( , subq_10.booking__paid_at__extract_day , subq_10.booking__paid_at__extract_dow , subq_10.booking__paid_at__extract_doy + , subq_10.metric_time__week + , subq_10.metric_time__month + , subq_10.metric_time__quarter + , subq_10.metric_time__year + , subq_10.metric_time__extract_year + , subq_10.metric_time__extract_quarter + , subq_10.metric_time__extract_month + , subq_10.metric_time__extract_day + , subq_10.metric_time__extract_dow + , subq_10.metric_time__extract_doy , subq_10.listing , subq_10.guest , subq_10.host @@ -450,16 +450,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_8.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_8.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_8.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_8.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_8.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_8.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_8.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_8.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_8.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_8.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_8.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_8.metric_time__day) AS metric_time__extract_doy , subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month @@ -526,6 +516,16 @@ FROM ( , subq_7.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_7.metric_time__week AS metric_time__week + , subq_7.metric_time__month AS metric_time__month + , subq_7.metric_time__quarter AS metric_time__quarter + , subq_7.metric_time__year AS metric_time__year + , subq_7.metric_time__extract_year AS metric_time__extract_year + , subq_7.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_7.metric_time__extract_month AS metric_time__extract_month + , subq_7.metric_time__extract_day AS metric_time__extract_day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow + , subq_7.metric_time__extract_doy AS metric_time__extract_doy , subq_7.listing AS listing , subq_7.guest AS guest , subq_7.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql index d4663973a..c9c070bfe 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_5.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_5.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_5.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_5.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_5.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_5.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_agg_time_dim__plan0.sql index 1df7cab10..c4a927f4a 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_agg_time_dim__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATETIME_TRUNC(subq_2.booking__ds__day, isoweek) AS booking__ds__week - , DATETIME_TRUNC(subq_2.booking__ds__day, month) AS booking__ds__month - , DATETIME_TRUNC(subq_2.booking__ds__day, quarter) AS booking__ds__quarter - , DATETIME_TRUNC(subq_2.booking__ds__day, year) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.booking__ds__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.booking__ds__day) - 1) AS booking__ds__extract_dow - , EXTRACT(dayofyear FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -74,6 +64,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql index 2982c1015..a95c8aa4e 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql index f468b603e..325401084 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql @@ -57,16 +57,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -133,6 +123,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets__plan0.sql index 4d4830152..a1f9b0034 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets__plan0.sql @@ -41,16 +41,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -117,6 +107,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets_with_time_constraint__plan0.sql index 976fcea6f..3525bf5d9 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets_with_time_constraint__plan0.sql @@ -42,16 +42,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -118,6 +108,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets_with_where_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets_with_where_constraint__plan0.sql index 3c351fcf5..d368d1cc0 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets_with_where_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_nested_offsets_with_where_constraint__plan0.sql @@ -46,16 +46,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -122,6 +112,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql index 40f11b475..3f77db76a 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql @@ -26,17 +26,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -103,6 +93,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -127,17 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 9b2141086..bce15e070 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -19,8 +19,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.ds AS metric_time__day - , DATETIME_TRUNC(subq_12.ds, month) AS metric_time__month + DATETIME_TRUNC(subq_12.ds, month) AS metric_time__month + , subq_10.metric_time__day AS metric_time__day , subq_10.bookings AS bookings FROM ***************************.mf_time_spine subq_12 INNER JOIN ( diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_multiple_granularities__plan0.sql index 306245462..a83cd1f6d 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_metric_multiple_granularities__plan0.sql @@ -35,16 +35,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -111,6 +103,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_with_agg_time_dim__plan0.sql index badbaea8f..df697c26c 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_to_grain_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATETIME_TRUNC(subq_7.booking__ds__day, isoweek) AS booking__ds__week - , DATETIME_TRUNC(subq_7.booking__ds__day, month) AS booking__ds__month - , DATETIME_TRUNC(subq_7.booking__ds__day, quarter) AS booking__ds__quarter - , DATETIME_TRUNC(subq_7.booking__ds__day, year) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , IF(EXTRACT(dayofweek FROM subq_7.booking__ds__day) = 1, 7, EXTRACT(dayofweek FROM subq_7.booking__ds__day) - 1) AS booking__ds__extract_dow - , EXTRACT(dayofyear FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql index dc10f38bd..8c53a7d0a 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql @@ -32,17 +32,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -109,6 +99,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -133,17 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +200,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 73536fe94..f58300038 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -25,8 +25,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_19.ds AS metric_time__day - , DATETIME_TRUNC(subq_19.ds, month) AS metric_time__month + DATETIME_TRUNC(subq_19.ds, month) AS metric_time__month + , DATETIME_TRUNC(bookings_source_src_28000.ds, day) AS metric_time__day , bookings_source_src_28000.booking_value AS booking_value FROM ***************************.mf_time_spine subq_19 INNER JOIN diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_multiple_granularities__plan0.sql index c8630a4c7..ae94bb921 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_metric_multiple_granularities__plan0.sql @@ -43,16 +43,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -119,6 +111,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_with_agg_time_dim__plan0.sql index a0ef99cfd..20dfb7835 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATETIME_TRUNC(subq_7.booking__ds__day, isoweek) AS booking__ds__week - , DATETIME_TRUNC(subq_7.booking__ds__day, month) AS booking__ds__month - , DATETIME_TRUNC(subq_7.booking__ds__day, quarter) AS booking__ds__quarter - , DATETIME_TRUNC(subq_7.booking__ds__day, year) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , IF(EXTRACT(dayofweek FROM subq_7.booking__ds__day) = 1, 7, EXTRACT(dayofweek FROM subq_7.booking__ds__day) - 1) AS booking__ds__extract_dow - , EXTRACT(dayofyear FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_time_offset_metric_with_time_constraint__plan0.sql index fa9169c91..cd4f97213 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/BigQuery/test_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql index 7b2561e64..16ffa2692 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Constrain Time Range to [2019-12-19T00:00:00, 2020-01-02T00:00:00] SELECT subq_7.metric_time__day - , subq_7.metric_time__week - , subq_7.metric_time__month - , subq_7.metric_time__quarter - , subq_7.metric_time__year - , subq_7.metric_time__extract_year - , subq_7.metric_time__extract_quarter - , subq_7.metric_time__extract_month - , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dow - , subq_7.metric_time__extract_doy , subq_7.ds__day , subq_7.ds__week , subq_7.ds__month @@ -101,6 +91,16 @@ FROM ( , subq_7.booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy + , subq_7.metric_time__week + , subq_7.metric_time__month + , subq_7.metric_time__quarter + , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -126,16 +126,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_5.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_5.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_5.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_5.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_5.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -202,6 +192,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql index 6118addb8..5acb3e5d8 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql @@ -25,11 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__month AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__month) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__month) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__month) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__month) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__month) AS metric_time__extract_month , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year @@ -42,6 +37,11 @@ FROM ( , subq_1.booking_monthly__ds__extract_year AS booking_monthly__ds__extract_year , subq_1.booking_monthly__ds__extract_quarter AS booking_monthly__ds__extract_quarter , subq_1.booking_monthly__ds__extract_month AS booking_monthly__ds__extract_month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.listing AS listing , subq_1.booking_monthly__listing AS booking_monthly__listing , subq_1.bookings_monthly AS bookings_monthly diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql index e634ee21b..7d7aa9351 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index ea7afdaf5..f792d1ab0 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql index 25f372d89..fdd749b31 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql index bd515b35c..afb647f8a 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 29cbdafdc..d4ade9d2b 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,16 +356,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -432,6 +422,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 5ebbd2a04..e8324ba7d 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -30,17 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,17 +356,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -433,6 +423,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__day AS metric_time__day + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_time_filter__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_time_filter__plan0.sql index 4875a4fc8..f4c919e27 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_time_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_time_filter__plan0.sql @@ -349,16 +349,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_10.metric_time__day - , subq_10.metric_time__week - , subq_10.metric_time__month - , subq_10.metric_time__quarter - , subq_10.metric_time__year - , subq_10.metric_time__extract_year - , subq_10.metric_time__extract_quarter - , subq_10.metric_time__extract_month - , subq_10.metric_time__extract_day - , subq_10.metric_time__extract_dow - , subq_10.metric_time__extract_doy , subq_10.ds__day , subq_10.ds__week , subq_10.ds__month @@ -425,6 +415,16 @@ FROM ( , subq_10.booking__paid_at__extract_day , subq_10.booking__paid_at__extract_dow , subq_10.booking__paid_at__extract_doy + , subq_10.metric_time__week + , subq_10.metric_time__month + , subq_10.metric_time__quarter + , subq_10.metric_time__year + , subq_10.metric_time__extract_year + , subq_10.metric_time__extract_quarter + , subq_10.metric_time__extract_month + , subq_10.metric_time__extract_day + , subq_10.metric_time__extract_dow + , subq_10.metric_time__extract_doy , subq_10.listing , subq_10.guest , subq_10.host @@ -450,16 +450,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_8.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_8.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_8.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_8.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_8.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_8.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_8.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_8.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_8.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_8.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_8.metric_time__day) AS metric_time__extract_doy , subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month @@ -526,6 +516,16 @@ FROM ( , subq_7.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_7.metric_time__week AS metric_time__week + , subq_7.metric_time__month AS metric_time__month + , subq_7.metric_time__quarter AS metric_time__quarter + , subq_7.metric_time__year AS metric_time__year + , subq_7.metric_time__extract_year AS metric_time__extract_year + , subq_7.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_7.metric_time__extract_month AS metric_time__extract_month + , subq_7.metric_time__extract_day AS metric_time__extract_day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow + , subq_7.metric_time__extract_doy AS metric_time__extract_doy , subq_7.listing AS listing , subq_7.guest AS guest , subq_7.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql index bd4eb3e83..7a88f67b6 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_5.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_5.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_5.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_5.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_5.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_agg_time_dim__plan0.sql index 774b395b8..8ca19b100 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_agg_time_dim__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_2.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_2.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_2.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_2.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -74,6 +64,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql index 31829a75c..ccaa3b6c4 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql index a746fa652..730fca211 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql @@ -57,16 +57,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -133,6 +123,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets__plan0.sql index 890c4e3e7..94457a2be 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets__plan0.sql @@ -41,16 +41,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -117,6 +107,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets_with_time_constraint__plan0.sql index 58d9e97d6..a3777e103 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets_with_time_constraint__plan0.sql @@ -42,16 +42,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -118,6 +108,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets_with_where_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets_with_where_constraint__plan0.sql index 35094f7bb..78c8f98e7 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets_with_where_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_nested_offsets_with_where_constraint__plan0.sql @@ -46,16 +46,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -122,6 +112,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql index ba971f9be..b3388e8d1 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql @@ -26,17 +26,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -103,6 +93,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -127,17 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index a45feb035..6a4dc6cff 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -19,8 +19,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.ds AS metric_time__day - , DATE_TRUNC('month', subq_12.ds) AS metric_time__month + DATE_TRUNC('month', subq_12.ds) AS metric_time__month + , subq_10.metric_time__day AS metric_time__day , subq_10.bookings AS bookings FROM ***************************.mf_time_spine subq_12 INNER JOIN ( diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_multiple_granularities__plan0.sql index b0d73d7f0..46a7954ae 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_metric_multiple_granularities__plan0.sql @@ -35,16 +35,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -111,6 +103,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_with_agg_time_dim__plan0.sql index bfb33d1a6..8c63963df 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_to_grain_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_7.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_7.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_7.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_7.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_7.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql index e46cb1e76..7572575e6 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql @@ -32,17 +32,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -109,6 +99,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -133,17 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +200,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 0acbd8cac..64709ee44 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -25,8 +25,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_19.ds AS metric_time__day - , DATE_TRUNC('month', subq_19.ds) AS metric_time__month + DATE_TRUNC('month', subq_19.ds) AS metric_time__month + , DATE_TRUNC('day', bookings_source_src_28000.ds) AS metric_time__day , bookings_source_src_28000.booking_value AS booking_value FROM ***************************.mf_time_spine subq_19 INNER JOIN diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_multiple_granularities__plan0.sql index 9013788a3..3977f5cb7 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_metric_multiple_granularities__plan0.sql @@ -43,16 +43,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -119,6 +111,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_with_agg_time_dim__plan0.sql index e195e45c3..b8b961e7b 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_offset_window_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_7.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_7.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_7.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_7.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_7.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_time_offset_metric_with_time_constraint__plan0.sql index 657dc7ed6..5176f8516 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Databricks/test_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql index 0927844d4..e7a776d64 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Constrain Time Range to [2019-12-19T00:00:00, 2020-01-02T00:00:00] SELECT subq_7.metric_time__day - , subq_7.metric_time__week - , subq_7.metric_time__month - , subq_7.metric_time__quarter - , subq_7.metric_time__year - , subq_7.metric_time__extract_year - , subq_7.metric_time__extract_quarter - , subq_7.metric_time__extract_month - , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dow - , subq_7.metric_time__extract_doy , subq_7.ds__day , subq_7.ds__week , subq_7.ds__month @@ -101,6 +91,16 @@ FROM ( , subq_7.booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy + , subq_7.metric_time__week + , subq_7.metric_time__month + , subq_7.metric_time__quarter + , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -126,16 +126,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_5.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_5.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_5.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_5.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_5.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -202,6 +192,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql index 4518dcda4..93ebb3135 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql @@ -25,11 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__month AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__month) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__month) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__month) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__month) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__month) AS metric_time__extract_month , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year @@ -42,6 +37,11 @@ FROM ( , subq_1.booking_monthly__ds__extract_year AS booking_monthly__ds__extract_year , subq_1.booking_monthly__ds__extract_quarter AS booking_monthly__ds__extract_quarter , subq_1.booking_monthly__ds__extract_month AS booking_monthly__ds__extract_month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.listing AS listing , subq_1.booking_monthly__listing AS booking_monthly__listing , subq_1.bookings_monthly AS bookings_monthly diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql index 18a8bd89f..e25a0010f 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 2fe28b5f2..2111c8945 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql index 95cc95943..2d15542c6 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 97dbca903..2344dcc31 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 6f643295f..7ae1d2eb4 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,16 +356,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -432,6 +422,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 2d25e0810..9a4536780 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -30,17 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,17 +356,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -433,6 +423,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__day AS metric_time__day + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_time_filter__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_time_filter__plan0.sql index d81a0bd29..4f7ecf502 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_time_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_time_filter__plan0.sql @@ -349,16 +349,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_10.metric_time__day - , subq_10.metric_time__week - , subq_10.metric_time__month - , subq_10.metric_time__quarter - , subq_10.metric_time__year - , subq_10.metric_time__extract_year - , subq_10.metric_time__extract_quarter - , subq_10.metric_time__extract_month - , subq_10.metric_time__extract_day - , subq_10.metric_time__extract_dow - , subq_10.metric_time__extract_doy , subq_10.ds__day , subq_10.ds__week , subq_10.ds__month @@ -425,6 +415,16 @@ FROM ( , subq_10.booking__paid_at__extract_day , subq_10.booking__paid_at__extract_dow , subq_10.booking__paid_at__extract_doy + , subq_10.metric_time__week + , subq_10.metric_time__month + , subq_10.metric_time__quarter + , subq_10.metric_time__year + , subq_10.metric_time__extract_year + , subq_10.metric_time__extract_quarter + , subq_10.metric_time__extract_month + , subq_10.metric_time__extract_day + , subq_10.metric_time__extract_dow + , subq_10.metric_time__extract_doy , subq_10.listing , subq_10.guest , subq_10.host @@ -450,16 +450,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_8.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_8.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_8.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_8.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_8.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_8.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_8.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_8.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_8.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_8.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_8.metric_time__day) AS metric_time__extract_doy , subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month @@ -526,6 +516,16 @@ FROM ( , subq_7.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_7.metric_time__week AS metric_time__week + , subq_7.metric_time__month AS metric_time__month + , subq_7.metric_time__quarter AS metric_time__quarter + , subq_7.metric_time__year AS metric_time__year + , subq_7.metric_time__extract_year AS metric_time__extract_year + , subq_7.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_7.metric_time__extract_month AS metric_time__extract_month + , subq_7.metric_time__extract_day AS metric_time__extract_day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow + , subq_7.metric_time__extract_doy AS metric_time__extract_doy , subq_7.listing AS listing , subq_7.guest AS guest , subq_7.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql index 1bb65d4bd..eea894032 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_5.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_5.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_5.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_5.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_5.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_agg_time_dim__plan0.sql index 064da1e7d..a07f9018a 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_agg_time_dim__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_2.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_2.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_2.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_2.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(isodow FROM subq_2.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -74,6 +64,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql index 9213168ed..22f7060c2 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql index f30a7ea83..221f93ec2 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql @@ -57,16 +57,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -133,6 +123,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets__plan0.sql index 52b31be08..36df5e99e 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets__plan0.sql @@ -41,16 +41,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -117,6 +107,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets_with_time_constraint__plan0.sql index 13a96edff..f75ae7237 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets_with_time_constraint__plan0.sql @@ -42,16 +42,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -118,6 +108,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets_with_where_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets_with_where_constraint__plan0.sql index 751d21034..7b4679dfb 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets_with_where_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_nested_offsets_with_where_constraint__plan0.sql @@ -46,16 +46,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -122,6 +112,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql index 89596a1ed..b88fd360e 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql @@ -26,17 +26,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -103,6 +93,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -127,17 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 52f737090..1a409e33f 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -19,8 +19,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.ds AS metric_time__day - , DATE_TRUNC('month', subq_12.ds) AS metric_time__month + DATE_TRUNC('month', subq_12.ds) AS metric_time__month + , subq_10.metric_time__day AS metric_time__day , subq_10.bookings AS bookings FROM ***************************.mf_time_spine subq_12 INNER JOIN ( diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_multiple_granularities__plan0.sql index 4e7a675cb..0c783016e 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_metric_multiple_granularities__plan0.sql @@ -35,16 +35,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -111,6 +103,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_with_agg_time_dim__plan0.sql index 653805878..d5393a5ab 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_to_grain_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_7.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_7.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_7.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_7.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(isodow FROM subq_7.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql index 52d416485..3209ff95a 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql @@ -32,17 +32,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -109,6 +99,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -133,17 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +200,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 3934f7c7b..854b6cf02 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -25,8 +25,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_19.ds AS metric_time__day - , DATE_TRUNC('month', subq_19.ds) AS metric_time__month + DATE_TRUNC('month', subq_19.ds) AS metric_time__month + , DATE_TRUNC('day', bookings_source_src_28000.ds) AS metric_time__day , bookings_source_src_28000.booking_value AS booking_value FROM ***************************.mf_time_spine subq_19 INNER JOIN diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_multiple_granularities__plan0.sql index 71b40a688..c9c7b82cc 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_metric_multiple_granularities__plan0.sql @@ -43,16 +43,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -119,6 +111,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_with_agg_time_dim__plan0.sql index 9bfdb6ef0..4197aa4fe 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_offset_window_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_7.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_7.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_7.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_7.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(isodow FROM subq_7.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_time_offset_metric_with_time_constraint__plan0.sql index b2bad3461..975d7267b 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Postgres/test_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql index 0b9759219..105d5d477 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Constrain Time Range to [2019-12-19T00:00:00, 2020-01-02T00:00:00] SELECT subq_7.metric_time__day - , subq_7.metric_time__week - , subq_7.metric_time__month - , subq_7.metric_time__quarter - , subq_7.metric_time__year - , subq_7.metric_time__extract_year - , subq_7.metric_time__extract_quarter - , subq_7.metric_time__extract_month - , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dow - , subq_7.metric_time__extract_doy , subq_7.ds__day , subq_7.ds__week , subq_7.ds__month @@ -101,6 +91,16 @@ FROM ( , subq_7.booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy + , subq_7.metric_time__week + , subq_7.metric_time__month + , subq_7.metric_time__quarter + , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -126,16 +126,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_5.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_5.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_5.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_5.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_5.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_5.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_5.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -202,6 +192,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql index a3eb7774e..783d28a0b 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql @@ -25,11 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__month AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__month) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__month) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__month) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__month) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__month) AS metric_time__extract_month , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year @@ -42,6 +37,11 @@ FROM ( , subq_1.booking_monthly__ds__extract_year AS booking_monthly__ds__extract_year , subq_1.booking_monthly__ds__extract_quarter AS booking_monthly__ds__extract_quarter , subq_1.booking_monthly__ds__extract_month AS booking_monthly__ds__extract_month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.listing AS listing , subq_1.booking_monthly__listing AS booking_monthly__listing , subq_1.bookings_monthly AS bookings_monthly diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql index f4a2fed1f..812538acb 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_7.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_7.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_7.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index cf24407aa..05fd6da80 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_7.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_7.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_7.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql index 2a433514d..7461ededc 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_7.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_7.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_7.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 07697b3a4..75f35eb71 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_7.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_7.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_7.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 2a31dc99d..ab2724a63 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,16 +356,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_10.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_10.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_10.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -432,6 +422,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 4b7f458d9..ee07090c3 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -30,17 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,17 +356,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_10.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_10.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_10.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -433,6 +423,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__day AS metric_time__day + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_time_filter__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_time_filter__plan0.sql index b77fdf6bf..f020af8c9 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_time_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_time_filter__plan0.sql @@ -349,16 +349,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_10.metric_time__day - , subq_10.metric_time__week - , subq_10.metric_time__month - , subq_10.metric_time__quarter - , subq_10.metric_time__year - , subq_10.metric_time__extract_year - , subq_10.metric_time__extract_quarter - , subq_10.metric_time__extract_month - , subq_10.metric_time__extract_day - , subq_10.metric_time__extract_dow - , subq_10.metric_time__extract_doy , subq_10.ds__day , subq_10.ds__week , subq_10.ds__month @@ -425,6 +415,16 @@ FROM ( , subq_10.booking__paid_at__extract_day , subq_10.booking__paid_at__extract_dow , subq_10.booking__paid_at__extract_doy + , subq_10.metric_time__week + , subq_10.metric_time__month + , subq_10.metric_time__quarter + , subq_10.metric_time__year + , subq_10.metric_time__extract_year + , subq_10.metric_time__extract_quarter + , subq_10.metric_time__extract_month + , subq_10.metric_time__extract_day + , subq_10.metric_time__extract_dow + , subq_10.metric_time__extract_doy , subq_10.listing , subq_10.guest , subq_10.host @@ -450,16 +450,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_8.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_8.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_8.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_8.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_8.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_8.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_8.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_8.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_8.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_8.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_8.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_8.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_8.metric_time__day) AS metric_time__extract_doy , subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month @@ -526,6 +516,16 @@ FROM ( , subq_7.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_7.metric_time__week AS metric_time__week + , subq_7.metric_time__month AS metric_time__month + , subq_7.metric_time__quarter AS metric_time__quarter + , subq_7.metric_time__year AS metric_time__year + , subq_7.metric_time__extract_year AS metric_time__extract_year + , subq_7.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_7.metric_time__extract_month AS metric_time__extract_month + , subq_7.metric_time__extract_day AS metric_time__extract_day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow + , subq_7.metric_time__extract_doy AS metric_time__extract_doy , subq_7.listing AS listing , subq_7.guest AS guest , subq_7.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql index 9c63f2ec3..aa66a538c 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_5.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_5.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_5.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_5.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_5.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_5.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_5.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_agg_time_dim__plan0.sql index 021ac16d7..df2faa021 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_agg_time_dim__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_2.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_2.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_2.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_2.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.booking__ds__day) = 0 THEN EXTRACT(dow FROM subq_2.booking__ds__day) + 7 ELSE EXTRACT(dow FROM subq_2.booking__ds__day) END AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -74,6 +64,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql index 4c35c5327..992f40492 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql index 5cc8fba65..4af2f8020 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql @@ -57,16 +57,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -133,6 +123,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets__plan0.sql index da0209be0..ab8b4fe8b 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets__plan0.sql @@ -41,16 +41,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -117,6 +107,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets_with_time_constraint__plan0.sql index f8b30e4fc..352194ea8 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets_with_time_constraint__plan0.sql @@ -42,16 +42,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -118,6 +108,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets_with_where_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets_with_where_constraint__plan0.sql index d2b3aa215..be2498019 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets_with_where_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_nested_offsets_with_where_constraint__plan0.sql @@ -46,16 +46,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -122,6 +112,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql index 7e622f5b0..bb8bebae2 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql @@ -26,17 +26,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -103,6 +93,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -127,17 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index e2ef45757..299a5317e 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -19,8 +19,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.ds AS metric_time__day - , DATE_TRUNC('month', subq_12.ds) AS metric_time__month + DATE_TRUNC('month', subq_12.ds) AS metric_time__month + , subq_10.metric_time__day AS metric_time__day , subq_10.bookings AS bookings FROM ***************************.mf_time_spine subq_12 INNER JOIN ( diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_multiple_granularities__plan0.sql index 79162bce6..8382aec4a 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_metric_multiple_granularities__plan0.sql @@ -35,16 +35,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -111,6 +103,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_with_agg_time_dim__plan0.sql index 2b8228302..1ec7288f5 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_to_grain_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_7.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_7.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_7.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_7.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , CASE WHEN EXTRACT(dow FROM subq_7.booking__ds__day) = 0 THEN EXTRACT(dow FROM subq_7.booking__ds__day) + 7 ELSE EXTRACT(dow FROM subq_7.booking__ds__day) END AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql index b2e4acb8f..cfab4f600 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql @@ -32,17 +32,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -109,6 +99,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -133,17 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +200,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 2608a60ba..c84292cba 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -25,8 +25,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_19.ds AS metric_time__day - , DATE_TRUNC('month', subq_19.ds) AS metric_time__month + DATE_TRUNC('month', subq_19.ds) AS metric_time__month + , DATE_TRUNC('day', bookings_source_src_28000.ds) AS metric_time__day , bookings_source_src_28000.booking_value AS booking_value FROM ***************************.mf_time_spine subq_19 INNER JOIN diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_multiple_granularities__plan0.sql index 83d556f54..8855b65d2 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_metric_multiple_granularities__plan0.sql @@ -43,16 +43,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -119,6 +111,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_with_agg_time_dim__plan0.sql index 47ef72345..b10fa0521 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_offset_window_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_7.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_7.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_7.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_7.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , CASE WHEN EXTRACT(dow FROM subq_7.booking__ds__day) = 0 THEN EXTRACT(dow FROM subq_7.booking__ds__day) + 7 ELSE EXTRACT(dow FROM subq_7.booking__ds__day) END AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_time_offset_metric_with_time_constraint__plan0.sql index 37b3e9f49..80650d8d7 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Redshift/test_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql index c2623ba16..557d1e6fe 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Constrain Time Range to [2019-12-19T00:00:00, 2020-01-02T00:00:00] SELECT subq_7.metric_time__day - , subq_7.metric_time__week - , subq_7.metric_time__month - , subq_7.metric_time__quarter - , subq_7.metric_time__year - , subq_7.metric_time__extract_year - , subq_7.metric_time__extract_quarter - , subq_7.metric_time__extract_month - , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dow - , subq_7.metric_time__extract_doy , subq_7.ds__day , subq_7.ds__week , subq_7.ds__month @@ -101,6 +91,16 @@ FROM ( , subq_7.booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy + , subq_7.metric_time__week + , subq_7.metric_time__month + , subq_7.metric_time__quarter + , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -126,16 +126,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_5.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_5.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_5.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_5.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_5.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -202,6 +192,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql index 4a1ea1fbc..ae2f922da 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql @@ -25,11 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__month AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__month) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__month) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__month) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__month) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__month) AS metric_time__extract_month , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year @@ -42,6 +37,11 @@ FROM ( , subq_1.booking_monthly__ds__extract_year AS booking_monthly__ds__extract_year , subq_1.booking_monthly__ds__extract_quarter AS booking_monthly__ds__extract_quarter , subq_1.booking_monthly__ds__extract_month AS booking_monthly__ds__extract_month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.listing AS listing , subq_1.booking_monthly__listing AS booking_monthly__listing , subq_1.bookings_monthly AS bookings_monthly diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql index 62142e1dd..c16d612c3 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 64a790683..ca4a37232 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql index a8e292868..e6f81dcfd 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 04b5e8c1c..7561adfaa 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index e616d74d7..40e536ad6 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,16 +356,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -432,6 +422,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 2e09e204d..4d53c9768 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -30,17 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,17 +356,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -433,6 +423,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__day AS metric_time__day + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_time_filter__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_time_filter__plan0.sql index 0de51ffc4..c884a8a58 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_time_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_time_filter__plan0.sql @@ -349,16 +349,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_10.metric_time__day - , subq_10.metric_time__week - , subq_10.metric_time__month - , subq_10.metric_time__quarter - , subq_10.metric_time__year - , subq_10.metric_time__extract_year - , subq_10.metric_time__extract_quarter - , subq_10.metric_time__extract_month - , subq_10.metric_time__extract_day - , subq_10.metric_time__extract_dow - , subq_10.metric_time__extract_doy , subq_10.ds__day , subq_10.ds__week , subq_10.ds__month @@ -425,6 +415,16 @@ FROM ( , subq_10.booking__paid_at__extract_day , subq_10.booking__paid_at__extract_dow , subq_10.booking__paid_at__extract_doy + , subq_10.metric_time__week + , subq_10.metric_time__month + , subq_10.metric_time__quarter + , subq_10.metric_time__year + , subq_10.metric_time__extract_year + , subq_10.metric_time__extract_quarter + , subq_10.metric_time__extract_month + , subq_10.metric_time__extract_day + , subq_10.metric_time__extract_dow + , subq_10.metric_time__extract_doy , subq_10.listing , subq_10.guest , subq_10.host @@ -450,16 +450,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_8.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_8.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_8.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_8.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_8.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_8.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_8.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_8.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_8.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_8.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_8.metric_time__day) AS metric_time__extract_doy , subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month @@ -526,6 +516,16 @@ FROM ( , subq_7.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_7.metric_time__week AS metric_time__week + , subq_7.metric_time__month AS metric_time__month + , subq_7.metric_time__quarter AS metric_time__quarter + , subq_7.metric_time__year AS metric_time__year + , subq_7.metric_time__extract_year AS metric_time__extract_year + , subq_7.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_7.metric_time__extract_month AS metric_time__extract_month + , subq_7.metric_time__extract_day AS metric_time__extract_day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow + , subq_7.metric_time__extract_doy AS metric_time__extract_doy , subq_7.listing AS listing , subq_7.guest AS guest , subq_7.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql index 437e55458..12bbfe786 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_5.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_5.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_5.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_5.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_5.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_agg_time_dim__plan0.sql index 73774979c..115c00e1b 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_agg_time_dim__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_2.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_2.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_2.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_2.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(dayofweekiso FROM subq_2.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -74,6 +64,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql index bc36f5bb5..3e0efcd5a 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql index b45f7776e..495c63745 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql @@ -57,16 +57,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -133,6 +123,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets__plan0.sql index 890155884..b86781bf0 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets__plan0.sql @@ -41,16 +41,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -117,6 +107,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets_with_time_constraint__plan0.sql index 10be64ac1..769d23bec 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets_with_time_constraint__plan0.sql @@ -42,16 +42,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -118,6 +108,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets_with_where_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets_with_where_constraint__plan0.sql index c50436acd..c4dd0ffbe 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets_with_where_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_nested_offsets_with_where_constraint__plan0.sql @@ -46,16 +46,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -122,6 +112,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql index 1b8d5f3c7..5efb6860c 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql @@ -26,17 +26,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -103,6 +93,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -127,17 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 2fec95707..a018fc10a 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -19,8 +19,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.ds AS metric_time__day - , DATE_TRUNC('month', subq_12.ds) AS metric_time__month + DATE_TRUNC('month', subq_12.ds) AS metric_time__month + , subq_10.metric_time__day AS metric_time__day , subq_10.bookings AS bookings FROM ***************************.mf_time_spine subq_12 INNER JOIN ( diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_multiple_granularities__plan0.sql index c9aaa5d3c..f90e5fa8f 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_metric_multiple_granularities__plan0.sql @@ -35,16 +35,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -111,6 +103,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_with_agg_time_dim__plan0.sql index 0add7b9ae..b75aa84f9 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_to_grain_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_7.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_7.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_7.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_7.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(dayofweekiso FROM subq_7.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql index b70bf53df..ac73be5b5 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql @@ -32,17 +32,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -109,6 +99,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -133,17 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +200,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 28159c151..f4ec730fd 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -25,8 +25,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_19.ds AS metric_time__day - , DATE_TRUNC('month', subq_19.ds) AS metric_time__month + DATE_TRUNC('month', subq_19.ds) AS metric_time__month + , DATE_TRUNC('day', bookings_source_src_28000.ds) AS metric_time__day , bookings_source_src_28000.booking_value AS booking_value FROM ***************************.mf_time_spine subq_19 INNER JOIN diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_multiple_granularities__plan0.sql index 1bf348eda..f3b8d2d80 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_metric_multiple_granularities__plan0.sql @@ -43,16 +43,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -119,6 +111,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_with_agg_time_dim__plan0.sql index cf02ce98e..5c8fd1589 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_7.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_7.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_7.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_7.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(dayofweekiso FROM subq_7.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_time_offset_metric_with_time_constraint__plan0.sql index f7320ca81..4420c336e 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Snowflake/test_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql index de3e61401..4fc4a2416 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Constrain Time Range to [2019-12-19T00:00:00, 2020-01-02T00:00:00] SELECT subq_7.metric_time__day - , subq_7.metric_time__week - , subq_7.metric_time__month - , subq_7.metric_time__quarter - , subq_7.metric_time__year - , subq_7.metric_time__extract_year - , subq_7.metric_time__extract_quarter - , subq_7.metric_time__extract_month - , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dow - , subq_7.metric_time__extract_doy , subq_7.ds__day , subq_7.ds__week , subq_7.ds__month @@ -101,6 +91,16 @@ FROM ( , subq_7.booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy + , subq_7.metric_time__week + , subq_7.metric_time__month + , subq_7.metric_time__quarter + , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -126,16 +126,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_5.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_5.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_5.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_5.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_5.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -202,6 +192,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql index d863e36e6..120935fa1 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql @@ -25,11 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__month AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__month) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__month) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__month) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__month) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__month) AS metric_time__extract_month , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year @@ -42,6 +37,11 @@ FROM ( , subq_1.booking_monthly__ds__extract_year AS booking_monthly__ds__extract_year , subq_1.booking_monthly__ds__extract_quarter AS booking_monthly__ds__extract_quarter , subq_1.booking_monthly__ds__extract_month AS booking_monthly__ds__extract_month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.listing AS listing , subq_1.booking_monthly__listing AS booking_monthly__listing , subq_1.bookings_monthly AS bookings_monthly diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_to_grain__plan0.sql index b206ee786..9289f7021 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_to_grain__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 1a44e848f..0cf3469d1 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window__plan0.sql index c5981d5cb..2d5963f8c 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 4512f1dde..c4c52ccc6 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_dow AS metric_time__extract_dow + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 8f12e7bb5..8f2321e8d 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,16 +356,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -432,6 +422,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index f86c7dbc0..cf738ae11 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -30,17 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -107,6 +97,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -356,17 +356,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -433,6 +423,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__day AS metric_time__day + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_time_filter__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_time_filter__plan0.sql index 7f723cac3..a0eb21571 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_time_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_metric_with_offset_window_and_time_filter__plan0.sql @@ -349,16 +349,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_10.metric_time__day - , subq_10.metric_time__week - , subq_10.metric_time__month - , subq_10.metric_time__quarter - , subq_10.metric_time__year - , subq_10.metric_time__extract_year - , subq_10.metric_time__extract_quarter - , subq_10.metric_time__extract_month - , subq_10.metric_time__extract_day - , subq_10.metric_time__extract_dow - , subq_10.metric_time__extract_doy , subq_10.ds__day , subq_10.ds__week , subq_10.ds__month @@ -425,6 +415,16 @@ FROM ( , subq_10.booking__paid_at__extract_day , subq_10.booking__paid_at__extract_dow , subq_10.booking__paid_at__extract_doy + , subq_10.metric_time__week + , subq_10.metric_time__month + , subq_10.metric_time__quarter + , subq_10.metric_time__year + , subq_10.metric_time__extract_year + , subq_10.metric_time__extract_quarter + , subq_10.metric_time__extract_month + , subq_10.metric_time__extract_day + , subq_10.metric_time__extract_dow + , subq_10.metric_time__extract_doy , subq_10.listing , subq_10.guest , subq_10.host @@ -450,16 +450,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_8.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_8.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_8.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_8.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_8.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_8.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_8.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_8.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_8.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_8.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_8.metric_time__day) AS metric_time__extract_doy , subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month @@ -526,6 +516,16 @@ FROM ( , subq_7.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_7.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_7.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_7.metric_time__week AS metric_time__week + , subq_7.metric_time__month AS metric_time__month + , subq_7.metric_time__quarter AS metric_time__quarter + , subq_7.metric_time__year AS metric_time__year + , subq_7.metric_time__extract_year AS metric_time__extract_year + , subq_7.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_7.metric_time__extract_month AS metric_time__extract_month + , subq_7.metric_time__extract_day AS metric_time__extract_day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow + , subq_7.metric_time__extract_doy AS metric_time__extract_doy , subq_7.listing AS listing , subq_7.guest AS guest , subq_7.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_cumulative_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_cumulative_metric__plan0.sql index 85b6e8fd7..32b446285 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_cumulative_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_cumulative_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_5.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_5.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_5.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_5.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_5.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_5.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_5.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_5.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_5.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_5.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_5.metric_time__day) AS metric_time__extract_doy , subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_4.metric_time__week AS metric_time__week + , subq_4.metric_time__month AS metric_time__month + , subq_4.metric_time__quarter AS metric_time__quarter + , subq_4.metric_time__year AS metric_time__year + , subq_4.metric_time__extract_year AS metric_time__extract_year + , subq_4.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_4.metric_time__extract_month AS metric_time__extract_month + , subq_4.metric_time__extract_day AS metric_time__extract_day + , subq_4.metric_time__extract_dow AS metric_time__extract_dow + , subq_4.metric_time__extract_doy AS metric_time__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_metric_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_metric_with_agg_time_dim__plan0.sql index c746f2616..58c9cbe4f 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_metric_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_metric_with_agg_time_dim__plan0.sql @@ -31,16 +31,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_2.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_2.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_2.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_2.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_2.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_2.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_2.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_2.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_2.booking__ds__day) AS booking__ds__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -74,6 +64,16 @@ FROM ( , subq_1.paid_at__extract_day AS paid_at__extract_day , subq_1.paid_at__extract_dow AS paid_at__extract_dow , subq_1.paid_at__extract_doy AS paid_at__extract_doy + , subq_1.booking__ds__week AS booking__ds__week + , subq_1.booking__ds__month AS booking__ds__month + , subq_1.booking__ds__quarter AS booking__ds__quarter + , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_metric_with_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_metric_with_one_input_metric__plan0.sql index 854446fc3..f30f6fc14 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql index 11de21528..f29e58481 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql @@ -57,16 +57,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -133,6 +123,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets__plan0.sql index d88fac446..d2801edc7 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets__plan0.sql @@ -41,16 +41,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -117,6 +107,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets_with_time_constraint__plan0.sql index a8c04f20d..4639f0b65 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets_with_time_constraint__plan0.sql @@ -42,16 +42,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -118,6 +108,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets_with_where_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets_with_where_constraint__plan0.sql index 7934462a2..c60220adc 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets_with_where_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_nested_offsets_with_where_constraint__plan0.sql @@ -46,16 +46,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -122,6 +112,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql index 714a52605..b710e45a9 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql @@ -26,17 +26,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -103,6 +93,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -127,17 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -204,6 +194,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 600f39647..a8f5ddb16 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -19,8 +19,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.ds AS metric_time__day - , DATE_TRUNC('month', subq_12.ds) AS metric_time__month + DATE_TRUNC('month', subq_12.ds) AS metric_time__month + , subq_10.metric_time__day AS metric_time__day , subq_10.bookings AS bookings FROM ***************************.mf_time_spine subq_12 INNER JOIN ( diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_multiple_granularities__plan0.sql index dde80c8c6..6d9f0250a 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_metric_multiple_granularities__plan0.sql @@ -35,16 +35,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -111,6 +103,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_with_agg_time_dim__plan0.sql index b3ce0598f..d949c4319 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_to_grain_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_7.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_7.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_7.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_7.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_7.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql index 83e94c14b..fabed71c9 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql @@ -32,17 +32,7 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__day - , subq_4.metric_time__week - , subq_4.metric_time__month - , subq_4.metric_time__quarter - , subq_4.metric_time__year - , subq_4.metric_time__extract_year - , subq_4.metric_time__extract_quarter - , subq_4.metric_time__extract_month - , subq_4.metric_time__extract_day - , subq_4.metric_time__extract_dow - , subq_4.metric_time__extract_doy + subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -109,6 +99,16 @@ FROM ( , subq_4.booking__paid_at__extract_day , subq_4.booking__paid_at__extract_dow , subq_4.booking__paid_at__extract_doy + , subq_4.metric_time__day + , subq_4.metric_time__week + , subq_4.metric_time__quarter + , subq_4.metric_time__year + , subq_4.metric_time__extract_year + , subq_4.metric_time__extract_quarter + , subq_4.metric_time__extract_month + , subq_4.metric_time__extract_day + , subq_4.metric_time__extract_dow + , subq_4.metric_time__extract_doy , subq_4.listing , subq_4.guest , subq_4.host @@ -133,17 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy + DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +200,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index c2acb8801..b65cacd2e 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -25,8 +25,8 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_19.ds AS metric_time__day - , DATE_TRUNC('month', subq_19.ds) AS metric_time__month + DATE_TRUNC('month', subq_19.ds) AS metric_time__month + , DATE_TRUNC('day', bookings_source_src_28000.ds) AS metric_time__day , bookings_source_src_28000.booking_value AS booking_value FROM ***************************.mf_time_spine subq_19 INNER JOIN diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_multiple_granularities__plan0.sql index 3de997c20..77678f8b6 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_metric_multiple_granularities__plan0.sql @@ -43,16 +43,8 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -119,6 +111,14 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_with_agg_time_dim__plan0.sql index 0810e1f3e..ec42f54a7 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_offset_window_with_agg_time_dim__plan0.sql @@ -246,16 +246,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_7.booking__ds__day AS booking__ds__day - , DATE_TRUNC('week', subq_7.booking__ds__day) AS booking__ds__week - , DATE_TRUNC('month', subq_7.booking__ds__day) AS booking__ds__month - , DATE_TRUNC('quarter', subq_7.booking__ds__day) AS booking__ds__quarter - , DATE_TRUNC('year', subq_7.booking__ds__day) AS booking__ds__year - , EXTRACT(year FROM subq_7.booking__ds__day) AS booking__ds__extract_year - , EXTRACT(quarter FROM subq_7.booking__ds__day) AS booking__ds__extract_quarter - , EXTRACT(month FROM subq_7.booking__ds__day) AS booking__ds__extract_month - , EXTRACT(day FROM subq_7.booking__ds__day) AS booking__ds__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_7.booking__ds__day) AS booking__ds__extract_dow - , EXTRACT(doy FROM subq_7.booking__ds__day) AS booking__ds__extract_doy , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -289,6 +279,16 @@ FROM ( , subq_6.paid_at__extract_day AS paid_at__extract_day , subq_6.paid_at__extract_dow AS paid_at__extract_dow , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_time_offset_metric_with_time_constraint__plan0.sql index a3cb95757..cbbf2eae8 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/Trino/test_time_offset_metric_with_time_constraint__plan0.sql @@ -25,16 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__day) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -101,6 +91,16 @@ FROM ( , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_derived_fill_nulls_for_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_derived_fill_nulls_for_one_input_metric__plan0.sql index 7acac83ff..846bb51c7 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_derived_fill_nulls_for_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_derived_fill_nulls_for_one_input_metric__plan0.sql @@ -260,16 +260,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_10.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_10.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_10.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_10.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_10.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_10.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -336,6 +326,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_derived_fill_nulls_for_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_derived_fill_nulls_for_one_input_metric__plan0.sql index aea9aa107..0b3d2f158 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_derived_fill_nulls_for_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_derived_fill_nulls_for_one_input_metric__plan0.sql @@ -260,16 +260,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -336,6 +326,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_derived_fill_nulls_for_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_derived_fill_nulls_for_one_input_metric__plan0.sql index 9dce854a0..72cb06db0 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_derived_fill_nulls_for_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_derived_fill_nulls_for_one_input_metric__plan0.sql @@ -260,16 +260,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -336,6 +326,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_derived_fill_nulls_for_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_derived_fill_nulls_for_one_input_metric__plan0.sql index 076e11a11..fce0b68b1 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_derived_fill_nulls_for_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_derived_fill_nulls_for_one_input_metric__plan0.sql @@ -260,16 +260,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_10.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_10.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_10.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -336,6 +326,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_derived_fill_nulls_for_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_derived_fill_nulls_for_one_input_metric__plan0.sql index 0b707cdc0..9ce54cd8e 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_derived_fill_nulls_for_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_derived_fill_nulls_for_one_input_metric__plan0.sql @@ -260,16 +260,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -336,6 +326,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_derived_fill_nulls_for_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_derived_fill_nulls_for_one_input_metric__plan0.sql index fa437bc1f..490a80a6f 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_derived_fill_nulls_for_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_derived_fill_nulls_for_one_input_metric__plan0.sql @@ -260,16 +260,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_10.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_10.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_10.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_10.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_10.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_10.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_10.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_10.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_10.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_10.metric_time__day) AS metric_time__extract_doy , subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month @@ -336,6 +326,16 @@ FROM ( , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_9.metric_time__week AS metric_time__week + , subq_9.metric_time__month AS metric_time__month + , subq_9.metric_time__quarter AS metric_time__quarter + , subq_9.metric_time__year AS metric_time__year + , subq_9.metric_time__extract_year AS metric_time__extract_year + , subq_9.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_9.metric_time__extract_month AS metric_time__extract_month + , subq_9.metric_time__extract_day AS metric_time__extract_day + , subq_9.metric_time__extract_dow AS metric_time__extract_dow + , subq_9.metric_time__extract_doy AS metric_time__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0.sql index b8e42a253..ab2139687 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_7.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_7.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_7.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_7.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_7.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_7.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_7.metric_time__day) AS metric_time__extract_doy + IF(EXTRACT(dayofweek FROM subq_7.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_7.metric_time__day) - 1) AS metric_time__extract_dow , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_subdaily_offset_to_grain_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_subdaily_offset_to_grain_metric__plan0.sql index 285492d2d..f6cbd6340 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_subdaily_offset_to_grain_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_subdaily_offset_to_grain_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATETIME_TRUNC(subq_2.metric_time__hour, day) AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__hour, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__hour, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__hour, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__hour, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__hour) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__hour) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_subdaily_offset_window_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_subdaily_offset_window_metric__plan0.sql index 0d5ad10ca..91f6460c8 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_subdaily_offset_window_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/BigQuery/test_subdaily_offset_window_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATETIME_TRUNC(subq_2.metric_time__hour, day) AS metric_time__day - , DATETIME_TRUNC(subq_2.metric_time__hour, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_2.metric_time__hour, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__hour, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_2.metric_time__hour, year) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_2.metric_time__hour) = 1, 7, EXTRACT(dayofweek FROM subq_2.metric_time__hour) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0.sql index c068eb504..586021ce5 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + EXTRACT(DAYOFWEEK_ISO FROM subq_7.metric_time__day) AS metric_time__extract_dow , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_subdaily_offset_to_grain_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_subdaily_offset_to_grain_metric__plan0.sql index 5a98cbfc6..bf9e66ea8 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_subdaily_offset_to_grain_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_subdaily_offset_to_grain_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATE_TRUNC('day', subq_2.metric_time__hour) AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__hour) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__hour) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__hour) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__hour) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__hour) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_subdaily_offset_window_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_subdaily_offset_window_metric__plan0.sql index e387ad907..097b13f08 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_subdaily_offset_window_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Databricks/test_subdaily_offset_window_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATE_TRUNC('day', subq_2.metric_time__hour) AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__hour) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__hour) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__hour) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__hour) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_2.metric_time__hour) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0.sql index 32bcbd547..863920537 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + EXTRACT(isodow FROM subq_7.metric_time__day) AS metric_time__extract_dow , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_subdaily_offset_to_grain_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_subdaily_offset_to_grain_metric__plan0.sql index c78bda1e0..4a4aa1d5d 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_subdaily_offset_to_grain_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_subdaily_offset_to_grain_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATE_TRUNC('day', subq_2.metric_time__hour) AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__hour) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__hour) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__hour) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__hour) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__hour) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_subdaily_offset_window_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_subdaily_offset_window_metric__plan0.sql index fa73c87f4..15163da5a 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_subdaily_offset_window_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Postgres/test_subdaily_offset_window_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATE_TRUNC('day', subq_2.metric_time__hour) AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__hour) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__hour) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__hour) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__hour) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_2.metric_time__hour) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0.sql index a23d8fe08..084b29ac9 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_7.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_7.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_7.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + CASE WHEN EXTRACT(dow FROM subq_7.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_7.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_7.metric_time__day) END AS metric_time__extract_dow , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_subdaily_offset_to_grain_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_subdaily_offset_to_grain_metric__plan0.sql index 9dd587159..60c1045d2 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_subdaily_offset_to_grain_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_subdaily_offset_to_grain_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATE_TRUNC('day', subq_2.metric_time__hour) AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__hour) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__hour) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__hour) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__hour) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__hour) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__hour) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__hour) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_subdaily_offset_window_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_subdaily_offset_window_metric__plan0.sql index 408983c56..53c91fdce 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_subdaily_offset_window_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Redshift/test_subdaily_offset_window_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATE_TRUNC('day', subq_2.metric_time__hour) AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__hour) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__hour) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__hour) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__hour) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_2.metric_time__hour) = 0 THEN EXTRACT(dow FROM subq_2.metric_time__hour) + 7 ELSE EXTRACT(dow FROM subq_2.metric_time__hour) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0.sql index 10c17d8dc..a5bfbf746 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + EXTRACT(dayofweekiso FROM subq_7.metric_time__day) AS metric_time__extract_dow , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_subdaily_offset_to_grain_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_subdaily_offset_to_grain_metric__plan0.sql index 96980f433..e4e795f63 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_subdaily_offset_to_grain_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_subdaily_offset_to_grain_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATE_TRUNC('day', subq_2.metric_time__hour) AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__hour) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__hour) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__hour) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__hour) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__hour) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_subdaily_offset_window_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_subdaily_offset_window_metric__plan0.sql index ea392fffb..23890bb35 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_subdaily_offset_window_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Snowflake/test_subdaily_offset_window_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATE_TRUNC('day', subq_2.metric_time__hour) AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__hour) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__hour) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__hour) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__hour) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_2.metric_time__hour) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_offset_window_with_date_part__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_offset_window_with_date_part__plan0.sql index adf84a41b..6a982eb19 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_offset_window_with_date_part__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_offset_window_with_date_part__plan0.sql @@ -245,17 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_7.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_7.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_7.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_7.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_7.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_7.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_7.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_7.metric_time__day) AS metric_time__extract_doy + EXTRACT(DAY_OF_WEEK FROM subq_7.metric_time__day) AS metric_time__extract_dow , subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month @@ -322,6 +312,16 @@ FROM ( , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.metric_time__day AS metric_time__day + , subq_6.metric_time__week AS metric_time__week + , subq_6.metric_time__month AS metric_time__month + , subq_6.metric_time__quarter AS metric_time__quarter + , subq_6.metric_time__year AS metric_time__year + , subq_6.metric_time__extract_year AS metric_time__extract_year + , subq_6.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_6.metric_time__extract_month AS metric_time__extract_month + , subq_6.metric_time__extract_day AS metric_time__extract_day + , subq_6.metric_time__extract_doy AS metric_time__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_subdaily_offset_to_grain_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_subdaily_offset_to_grain_metric__plan0.sql index d60b3bac0..74b767a3c 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_subdaily_offset_to_grain_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_subdaily_offset_to_grain_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATE_TRUNC('day', subq_2.metric_time__hour) AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__hour) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__hour) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__hour) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__hour) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__hour) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_subdaily_offset_window_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_subdaily_offset_window_metric__plan0.sql index 8a7f7a0b1..384799b70 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_subdaily_offset_window_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/Trino/test_subdaily_offset_window_metric__plan0.sql @@ -25,17 +25,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_2.metric_time__hour AS metric_time__hour - , DATE_TRUNC('day', subq_2.metric_time__hour) AS metric_time__day - , DATE_TRUNC('week', subq_2.metric_time__hour) AS metric_time__week - , DATE_TRUNC('month', subq_2.metric_time__hour) AS metric_time__month - , DATE_TRUNC('quarter', subq_2.metric_time__hour) AS metric_time__quarter - , DATE_TRUNC('year', subq_2.metric_time__hour) AS metric_time__year - , EXTRACT(year FROM subq_2.metric_time__hour) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_2.metric_time__hour) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_2.metric_time__hour) AS metric_time__extract_month - , EXTRACT(day FROM subq_2.metric_time__hour) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_2.metric_time__hour) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_2.metric_time__hour) AS metric_time__extract_doy , subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month @@ -210,6 +199,17 @@ FROM ( , subq_1.user__archived_at__extract_day AS user__archived_at__extract_day , subq_1.user__archived_at__extract_dow AS user__archived_at__extract_dow , subq_1.user__archived_at__extract_doy AS user__archived_at__extract_doy + , subq_1.metric_time__day AS metric_time__day + , subq_1.metric_time__week AS metric_time__week + , subq_1.metric_time__month AS metric_time__month + , subq_1.metric_time__quarter AS metric_time__quarter + , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.user AS user , subq_1.home_state AS home_state , subq_1.user__home_state AS user__home_state diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/BigQuery/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/BigQuery/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql index 64f3776b5..393782f27 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/BigQuery/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/BigQuery/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql @@ -633,16 +633,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_21.metric_time__day - , subq_21.metric_time__week - , subq_21.metric_time__month - , subq_21.metric_time__quarter - , subq_21.metric_time__year - , subq_21.metric_time__extract_year - , subq_21.metric_time__extract_quarter - , subq_21.metric_time__extract_month - , subq_21.metric_time__extract_day - , subq_21.metric_time__extract_dow - , subq_21.metric_time__extract_doy , subq_21.ds__day , subq_21.ds__week , subq_21.ds__month @@ -709,6 +699,16 @@ FROM ( , subq_21.booking__paid_at__extract_day , subq_21.booking__paid_at__extract_dow , subq_21.booking__paid_at__extract_doy + , subq_21.metric_time__week + , subq_21.metric_time__month + , subq_21.metric_time__quarter + , subq_21.metric_time__year + , subq_21.metric_time__extract_year + , subq_21.metric_time__extract_quarter + , subq_21.metric_time__extract_month + , subq_21.metric_time__extract_day + , subq_21.metric_time__extract_dow + , subq_21.metric_time__extract_doy , subq_21.listing , subq_21.guest , subq_21.host @@ -736,16 +736,6 @@ FROM ( SELECT subq_20.country_latest AS listing__country_latest , subq_17.metric_time__day AS metric_time__day - , subq_17.metric_time__week AS metric_time__week - , subq_17.metric_time__month AS metric_time__month - , subq_17.metric_time__quarter AS metric_time__quarter - , subq_17.metric_time__year AS metric_time__year - , subq_17.metric_time__extract_year AS metric_time__extract_year - , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_17.metric_time__extract_month AS metric_time__extract_month - , subq_17.metric_time__extract_day AS metric_time__extract_day - , subq_17.metric_time__extract_dow AS metric_time__extract_dow - , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.ds__day AS ds__day , subq_17.ds__week AS ds__week , subq_17.ds__month AS ds__month @@ -812,6 +802,16 @@ FROM ( , subq_17.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_17.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_17.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_17.metric_time__week AS metric_time__week + , subq_17.metric_time__month AS metric_time__month + , subq_17.metric_time__quarter AS metric_time__quarter + , subq_17.metric_time__year AS metric_time__year + , subq_17.metric_time__extract_year AS metric_time__extract_year + , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_17.metric_time__extract_month AS metric_time__extract_month + , subq_17.metric_time__extract_day AS metric_time__extract_day + , subq_17.metric_time__extract_dow AS metric_time__extract_dow + , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.listing AS listing , subq_17.guest AS guest , subq_17.host AS host @@ -837,16 +837,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_15.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_15.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_15.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_15.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_15.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_15.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_15.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_15.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_15.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_15.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_15.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_15.metric_time__day) AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -913,6 +903,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/BigQuery/test_offset_metric_with_query_time_filters__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/BigQuery/test_offset_metric_with_query_time_filters__plan0.sql index ad4b73820..d9a3c7f8e 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/BigQuery/test_offset_metric_with_query_time_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/BigQuery/test_offset_metric_with_query_time_filters__plan0.sql @@ -606,16 +606,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_18.metric_time__day - , subq_18.metric_time__week - , subq_18.metric_time__month - , subq_18.metric_time__quarter - , subq_18.metric_time__year - , subq_18.metric_time__extract_year - , subq_18.metric_time__extract_quarter - , subq_18.metric_time__extract_month - , subq_18.metric_time__extract_day - , subq_18.metric_time__extract_dow - , subq_18.metric_time__extract_doy , subq_18.ds__day , subq_18.ds__week , subq_18.ds__month @@ -682,6 +672,16 @@ FROM ( , subq_18.booking__paid_at__extract_day , subq_18.booking__paid_at__extract_dow , subq_18.booking__paid_at__extract_doy + , subq_18.metric_time__week + , subq_18.metric_time__month + , subq_18.metric_time__quarter + , subq_18.metric_time__year + , subq_18.metric_time__extract_year + , subq_18.metric_time__extract_quarter + , subq_18.metric_time__extract_month + , subq_18.metric_time__extract_day + , subq_18.metric_time__extract_dow + , subq_18.metric_time__extract_doy , subq_18.listing , subq_18.guest , subq_18.host @@ -709,16 +709,6 @@ FROM ( SELECT subq_17.country_latest AS listing__country_latest , subq_14.metric_time__day AS metric_time__day - , subq_14.metric_time__week AS metric_time__week - , subq_14.metric_time__month AS metric_time__month - , subq_14.metric_time__quarter AS metric_time__quarter - , subq_14.metric_time__year AS metric_time__year - , subq_14.metric_time__extract_year AS metric_time__extract_year - , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_14.metric_time__extract_month AS metric_time__extract_month - , subq_14.metric_time__extract_day AS metric_time__extract_day - , subq_14.metric_time__extract_dow AS metric_time__extract_dow - , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -785,6 +775,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host @@ -810,16 +810,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_12.metric_time__day AS metric_time__day - , DATETIME_TRUNC(subq_12.metric_time__day, isoweek) AS metric_time__week - , DATETIME_TRUNC(subq_12.metric_time__day, month) AS metric_time__month - , DATETIME_TRUNC(subq_12.metric_time__day, quarter) AS metric_time__quarter - , DATETIME_TRUNC(subq_12.metric_time__day, year) AS metric_time__year - , EXTRACT(year FROM subq_12.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_12.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_12.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_12.metric_time__day) AS metric_time__extract_day - , IF(EXTRACT(dayofweek FROM subq_12.metric_time__day) = 1, 7, EXTRACT(dayofweek FROM subq_12.metric_time__day) - 1) AS metric_time__extract_dow - , EXTRACT(dayofyear FROM subq_12.metric_time__day) AS metric_time__extract_doy , subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month @@ -886,6 +876,16 @@ FROM ( , subq_11.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_11.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_11.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_11.metric_time__week AS metric_time__week + , subq_11.metric_time__month AS metric_time__month + , subq_11.metric_time__quarter AS metric_time__quarter + , subq_11.metric_time__year AS metric_time__year + , subq_11.metric_time__extract_year AS metric_time__extract_year + , subq_11.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_11.metric_time__extract_month AS metric_time__extract_month + , subq_11.metric_time__extract_day AS metric_time__extract_day + , subq_11.metric_time__extract_dow AS metric_time__extract_dow + , subq_11.metric_time__extract_doy AS metric_time__extract_doy , subq_11.listing AS listing , subq_11.guest AS guest , subq_11.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Databricks/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Databricks/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql index a31c378f6..8ca173f41 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Databricks/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Databricks/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql @@ -633,16 +633,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_21.metric_time__day - , subq_21.metric_time__week - , subq_21.metric_time__month - , subq_21.metric_time__quarter - , subq_21.metric_time__year - , subq_21.metric_time__extract_year - , subq_21.metric_time__extract_quarter - , subq_21.metric_time__extract_month - , subq_21.metric_time__extract_day - , subq_21.metric_time__extract_dow - , subq_21.metric_time__extract_doy , subq_21.ds__day , subq_21.ds__week , subq_21.ds__month @@ -709,6 +699,16 @@ FROM ( , subq_21.booking__paid_at__extract_day , subq_21.booking__paid_at__extract_dow , subq_21.booking__paid_at__extract_doy + , subq_21.metric_time__week + , subq_21.metric_time__month + , subq_21.metric_time__quarter + , subq_21.metric_time__year + , subq_21.metric_time__extract_year + , subq_21.metric_time__extract_quarter + , subq_21.metric_time__extract_month + , subq_21.metric_time__extract_day + , subq_21.metric_time__extract_dow + , subq_21.metric_time__extract_doy , subq_21.listing , subq_21.guest , subq_21.host @@ -736,16 +736,6 @@ FROM ( SELECT subq_20.country_latest AS listing__country_latest , subq_17.metric_time__day AS metric_time__day - , subq_17.metric_time__week AS metric_time__week - , subq_17.metric_time__month AS metric_time__month - , subq_17.metric_time__quarter AS metric_time__quarter - , subq_17.metric_time__year AS metric_time__year - , subq_17.metric_time__extract_year AS metric_time__extract_year - , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_17.metric_time__extract_month AS metric_time__extract_month - , subq_17.metric_time__extract_day AS metric_time__extract_day - , subq_17.metric_time__extract_dow AS metric_time__extract_dow - , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.ds__day AS ds__day , subq_17.ds__week AS ds__week , subq_17.ds__month AS ds__month @@ -812,6 +802,16 @@ FROM ( , subq_17.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_17.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_17.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_17.metric_time__week AS metric_time__week + , subq_17.metric_time__month AS metric_time__month + , subq_17.metric_time__quarter AS metric_time__quarter + , subq_17.metric_time__year AS metric_time__year + , subq_17.metric_time__extract_year AS metric_time__extract_year + , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_17.metric_time__extract_month AS metric_time__extract_month + , subq_17.metric_time__extract_day AS metric_time__extract_day + , subq_17.metric_time__extract_dow AS metric_time__extract_dow + , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.listing AS listing , subq_17.guest AS guest , subq_17.host AS host @@ -837,16 +837,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_15.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_15.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_15.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_15.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_15.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_15.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_15.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_15.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_15.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_15.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_15.metric_time__day) AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -913,6 +903,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Databricks/test_offset_metric_with_query_time_filters__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Databricks/test_offset_metric_with_query_time_filters__plan0.sql index fc5c44e96..b41872c4c 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Databricks/test_offset_metric_with_query_time_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Databricks/test_offset_metric_with_query_time_filters__plan0.sql @@ -606,16 +606,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_18.metric_time__day - , subq_18.metric_time__week - , subq_18.metric_time__month - , subq_18.metric_time__quarter - , subq_18.metric_time__year - , subq_18.metric_time__extract_year - , subq_18.metric_time__extract_quarter - , subq_18.metric_time__extract_month - , subq_18.metric_time__extract_day - , subq_18.metric_time__extract_dow - , subq_18.metric_time__extract_doy , subq_18.ds__day , subq_18.ds__week , subq_18.ds__month @@ -682,6 +672,16 @@ FROM ( , subq_18.booking__paid_at__extract_day , subq_18.booking__paid_at__extract_dow , subq_18.booking__paid_at__extract_doy + , subq_18.metric_time__week + , subq_18.metric_time__month + , subq_18.metric_time__quarter + , subq_18.metric_time__year + , subq_18.metric_time__extract_year + , subq_18.metric_time__extract_quarter + , subq_18.metric_time__extract_month + , subq_18.metric_time__extract_day + , subq_18.metric_time__extract_dow + , subq_18.metric_time__extract_doy , subq_18.listing , subq_18.guest , subq_18.host @@ -709,16 +709,6 @@ FROM ( SELECT subq_17.country_latest AS listing__country_latest , subq_14.metric_time__day AS metric_time__day - , subq_14.metric_time__week AS metric_time__week - , subq_14.metric_time__month AS metric_time__month - , subq_14.metric_time__quarter AS metric_time__quarter - , subq_14.metric_time__year AS metric_time__year - , subq_14.metric_time__extract_year AS metric_time__extract_year - , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_14.metric_time__extract_month AS metric_time__extract_month - , subq_14.metric_time__extract_day AS metric_time__extract_day - , subq_14.metric_time__extract_dow AS metric_time__extract_dow - , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -785,6 +775,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host @@ -810,16 +810,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_12.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_12.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_12.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_12.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_12.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_12.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_12.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_12.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_12.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK_ISO FROM subq_12.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_12.metric_time__day) AS metric_time__extract_doy , subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month @@ -886,6 +876,16 @@ FROM ( , subq_11.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_11.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_11.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_11.metric_time__week AS metric_time__week + , subq_11.metric_time__month AS metric_time__month + , subq_11.metric_time__quarter AS metric_time__quarter + , subq_11.metric_time__year AS metric_time__year + , subq_11.metric_time__extract_year AS metric_time__extract_year + , subq_11.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_11.metric_time__extract_month AS metric_time__extract_month + , subq_11.metric_time__extract_day AS metric_time__extract_day + , subq_11.metric_time__extract_dow AS metric_time__extract_dow + , subq_11.metric_time__extract_doy AS metric_time__extract_doy , subq_11.listing AS listing , subq_11.guest AS guest , subq_11.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Postgres/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Postgres/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql index b2e5f0ec2..73b0e1ff7 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Postgres/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Postgres/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql @@ -633,16 +633,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_21.metric_time__day - , subq_21.metric_time__week - , subq_21.metric_time__month - , subq_21.metric_time__quarter - , subq_21.metric_time__year - , subq_21.metric_time__extract_year - , subq_21.metric_time__extract_quarter - , subq_21.metric_time__extract_month - , subq_21.metric_time__extract_day - , subq_21.metric_time__extract_dow - , subq_21.metric_time__extract_doy , subq_21.ds__day , subq_21.ds__week , subq_21.ds__month @@ -709,6 +699,16 @@ FROM ( , subq_21.booking__paid_at__extract_day , subq_21.booking__paid_at__extract_dow , subq_21.booking__paid_at__extract_doy + , subq_21.metric_time__week + , subq_21.metric_time__month + , subq_21.metric_time__quarter + , subq_21.metric_time__year + , subq_21.metric_time__extract_year + , subq_21.metric_time__extract_quarter + , subq_21.metric_time__extract_month + , subq_21.metric_time__extract_day + , subq_21.metric_time__extract_dow + , subq_21.metric_time__extract_doy , subq_21.listing , subq_21.guest , subq_21.host @@ -736,16 +736,6 @@ FROM ( SELECT subq_20.country_latest AS listing__country_latest , subq_17.metric_time__day AS metric_time__day - , subq_17.metric_time__week AS metric_time__week - , subq_17.metric_time__month AS metric_time__month - , subq_17.metric_time__quarter AS metric_time__quarter - , subq_17.metric_time__year AS metric_time__year - , subq_17.metric_time__extract_year AS metric_time__extract_year - , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_17.metric_time__extract_month AS metric_time__extract_month - , subq_17.metric_time__extract_day AS metric_time__extract_day - , subq_17.metric_time__extract_dow AS metric_time__extract_dow - , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.ds__day AS ds__day , subq_17.ds__week AS ds__week , subq_17.ds__month AS ds__month @@ -812,6 +802,16 @@ FROM ( , subq_17.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_17.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_17.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_17.metric_time__week AS metric_time__week + , subq_17.metric_time__month AS metric_time__month + , subq_17.metric_time__quarter AS metric_time__quarter + , subq_17.metric_time__year AS metric_time__year + , subq_17.metric_time__extract_year AS metric_time__extract_year + , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_17.metric_time__extract_month AS metric_time__extract_month + , subq_17.metric_time__extract_day AS metric_time__extract_day + , subq_17.metric_time__extract_dow AS metric_time__extract_dow + , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.listing AS listing , subq_17.guest AS guest , subq_17.host AS host @@ -837,16 +837,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_15.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_15.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_15.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_15.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_15.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_15.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_15.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_15.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_15.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_15.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_15.metric_time__day) AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -913,6 +903,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Postgres/test_offset_metric_with_query_time_filters__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Postgres/test_offset_metric_with_query_time_filters__plan0.sql index 36e886bb4..5e5ff825b 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Postgres/test_offset_metric_with_query_time_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Postgres/test_offset_metric_with_query_time_filters__plan0.sql @@ -606,16 +606,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_18.metric_time__day - , subq_18.metric_time__week - , subq_18.metric_time__month - , subq_18.metric_time__quarter - , subq_18.metric_time__year - , subq_18.metric_time__extract_year - , subq_18.metric_time__extract_quarter - , subq_18.metric_time__extract_month - , subq_18.metric_time__extract_day - , subq_18.metric_time__extract_dow - , subq_18.metric_time__extract_doy , subq_18.ds__day , subq_18.ds__week , subq_18.ds__month @@ -682,6 +672,16 @@ FROM ( , subq_18.booking__paid_at__extract_day , subq_18.booking__paid_at__extract_dow , subq_18.booking__paid_at__extract_doy + , subq_18.metric_time__week + , subq_18.metric_time__month + , subq_18.metric_time__quarter + , subq_18.metric_time__year + , subq_18.metric_time__extract_year + , subq_18.metric_time__extract_quarter + , subq_18.metric_time__extract_month + , subq_18.metric_time__extract_day + , subq_18.metric_time__extract_dow + , subq_18.metric_time__extract_doy , subq_18.listing , subq_18.guest , subq_18.host @@ -709,16 +709,6 @@ FROM ( SELECT subq_17.country_latest AS listing__country_latest , subq_14.metric_time__day AS metric_time__day - , subq_14.metric_time__week AS metric_time__week - , subq_14.metric_time__month AS metric_time__month - , subq_14.metric_time__quarter AS metric_time__quarter - , subq_14.metric_time__year AS metric_time__year - , subq_14.metric_time__extract_year AS metric_time__extract_year - , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_14.metric_time__extract_month AS metric_time__extract_month - , subq_14.metric_time__extract_day AS metric_time__extract_day - , subq_14.metric_time__extract_dow AS metric_time__extract_dow - , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -785,6 +775,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host @@ -810,16 +810,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_12.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_12.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_12.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_12.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_12.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_12.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_12.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_12.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_12.metric_time__day) AS metric_time__extract_day - , EXTRACT(isodow FROM subq_12.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_12.metric_time__day) AS metric_time__extract_doy , subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month @@ -886,6 +876,16 @@ FROM ( , subq_11.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_11.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_11.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_11.metric_time__week AS metric_time__week + , subq_11.metric_time__month AS metric_time__month + , subq_11.metric_time__quarter AS metric_time__quarter + , subq_11.metric_time__year AS metric_time__year + , subq_11.metric_time__extract_year AS metric_time__extract_year + , subq_11.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_11.metric_time__extract_month AS metric_time__extract_month + , subq_11.metric_time__extract_day AS metric_time__extract_day + , subq_11.metric_time__extract_dow AS metric_time__extract_dow + , subq_11.metric_time__extract_doy AS metric_time__extract_doy , subq_11.listing AS listing , subq_11.guest AS guest , subq_11.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Redshift/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Redshift/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql index 7e3af3962..891ef6bdc 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Redshift/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Redshift/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql @@ -633,16 +633,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_21.metric_time__day - , subq_21.metric_time__week - , subq_21.metric_time__month - , subq_21.metric_time__quarter - , subq_21.metric_time__year - , subq_21.metric_time__extract_year - , subq_21.metric_time__extract_quarter - , subq_21.metric_time__extract_month - , subq_21.metric_time__extract_day - , subq_21.metric_time__extract_dow - , subq_21.metric_time__extract_doy , subq_21.ds__day , subq_21.ds__week , subq_21.ds__month @@ -709,6 +699,16 @@ FROM ( , subq_21.booking__paid_at__extract_day , subq_21.booking__paid_at__extract_dow , subq_21.booking__paid_at__extract_doy + , subq_21.metric_time__week + , subq_21.metric_time__month + , subq_21.metric_time__quarter + , subq_21.metric_time__year + , subq_21.metric_time__extract_year + , subq_21.metric_time__extract_quarter + , subq_21.metric_time__extract_month + , subq_21.metric_time__extract_day + , subq_21.metric_time__extract_dow + , subq_21.metric_time__extract_doy , subq_21.listing , subq_21.guest , subq_21.host @@ -736,16 +736,6 @@ FROM ( SELECT subq_20.country_latest AS listing__country_latest , subq_17.metric_time__day AS metric_time__day - , subq_17.metric_time__week AS metric_time__week - , subq_17.metric_time__month AS metric_time__month - , subq_17.metric_time__quarter AS metric_time__quarter - , subq_17.metric_time__year AS metric_time__year - , subq_17.metric_time__extract_year AS metric_time__extract_year - , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_17.metric_time__extract_month AS metric_time__extract_month - , subq_17.metric_time__extract_day AS metric_time__extract_day - , subq_17.metric_time__extract_dow AS metric_time__extract_dow - , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.ds__day AS ds__day , subq_17.ds__week AS ds__week , subq_17.ds__month AS ds__month @@ -812,6 +802,16 @@ FROM ( , subq_17.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_17.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_17.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_17.metric_time__week AS metric_time__week + , subq_17.metric_time__month AS metric_time__month + , subq_17.metric_time__quarter AS metric_time__quarter + , subq_17.metric_time__year AS metric_time__year + , subq_17.metric_time__extract_year AS metric_time__extract_year + , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_17.metric_time__extract_month AS metric_time__extract_month + , subq_17.metric_time__extract_day AS metric_time__extract_day + , subq_17.metric_time__extract_dow AS metric_time__extract_dow + , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.listing AS listing , subq_17.guest AS guest , subq_17.host AS host @@ -837,16 +837,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_15.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_15.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_15.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_15.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_15.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_15.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_15.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_15.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_15.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_15.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_15.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_15.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_15.metric_time__day) AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -913,6 +903,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Redshift/test_offset_metric_with_query_time_filters__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Redshift/test_offset_metric_with_query_time_filters__plan0.sql index 2eda004d9..89dfe569d 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Redshift/test_offset_metric_with_query_time_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Redshift/test_offset_metric_with_query_time_filters__plan0.sql @@ -606,16 +606,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_18.metric_time__day - , subq_18.metric_time__week - , subq_18.metric_time__month - , subq_18.metric_time__quarter - , subq_18.metric_time__year - , subq_18.metric_time__extract_year - , subq_18.metric_time__extract_quarter - , subq_18.metric_time__extract_month - , subq_18.metric_time__extract_day - , subq_18.metric_time__extract_dow - , subq_18.metric_time__extract_doy , subq_18.ds__day , subq_18.ds__week , subq_18.ds__month @@ -682,6 +672,16 @@ FROM ( , subq_18.booking__paid_at__extract_day , subq_18.booking__paid_at__extract_dow , subq_18.booking__paid_at__extract_doy + , subq_18.metric_time__week + , subq_18.metric_time__month + , subq_18.metric_time__quarter + , subq_18.metric_time__year + , subq_18.metric_time__extract_year + , subq_18.metric_time__extract_quarter + , subq_18.metric_time__extract_month + , subq_18.metric_time__extract_day + , subq_18.metric_time__extract_dow + , subq_18.metric_time__extract_doy , subq_18.listing , subq_18.guest , subq_18.host @@ -709,16 +709,6 @@ FROM ( SELECT subq_17.country_latest AS listing__country_latest , subq_14.metric_time__day AS metric_time__day - , subq_14.metric_time__week AS metric_time__week - , subq_14.metric_time__month AS metric_time__month - , subq_14.metric_time__quarter AS metric_time__quarter - , subq_14.metric_time__year AS metric_time__year - , subq_14.metric_time__extract_year AS metric_time__extract_year - , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_14.metric_time__extract_month AS metric_time__extract_month - , subq_14.metric_time__extract_day AS metric_time__extract_day - , subq_14.metric_time__extract_dow AS metric_time__extract_dow - , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -785,6 +775,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host @@ -810,16 +810,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_12.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_12.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_12.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_12.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_12.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_12.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_12.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_12.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_12.metric_time__day) AS metric_time__extract_day - , CASE WHEN EXTRACT(dow FROM subq_12.metric_time__day) = 0 THEN EXTRACT(dow FROM subq_12.metric_time__day) + 7 ELSE EXTRACT(dow FROM subq_12.metric_time__day) END AS metric_time__extract_dow - , EXTRACT(doy FROM subq_12.metric_time__day) AS metric_time__extract_doy , subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month @@ -886,6 +876,16 @@ FROM ( , subq_11.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_11.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_11.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_11.metric_time__week AS metric_time__week + , subq_11.metric_time__month AS metric_time__month + , subq_11.metric_time__quarter AS metric_time__quarter + , subq_11.metric_time__year AS metric_time__year + , subq_11.metric_time__extract_year AS metric_time__extract_year + , subq_11.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_11.metric_time__extract_month AS metric_time__extract_month + , subq_11.metric_time__extract_day AS metric_time__extract_day + , subq_11.metric_time__extract_dow AS metric_time__extract_dow + , subq_11.metric_time__extract_doy AS metric_time__extract_doy , subq_11.listing AS listing , subq_11.guest AS guest , subq_11.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Snowflake/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Snowflake/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql index 3d1cc0484..a8c53b115 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Snowflake/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Snowflake/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql @@ -633,16 +633,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_21.metric_time__day - , subq_21.metric_time__week - , subq_21.metric_time__month - , subq_21.metric_time__quarter - , subq_21.metric_time__year - , subq_21.metric_time__extract_year - , subq_21.metric_time__extract_quarter - , subq_21.metric_time__extract_month - , subq_21.metric_time__extract_day - , subq_21.metric_time__extract_dow - , subq_21.metric_time__extract_doy , subq_21.ds__day , subq_21.ds__week , subq_21.ds__month @@ -709,6 +699,16 @@ FROM ( , subq_21.booking__paid_at__extract_day , subq_21.booking__paid_at__extract_dow , subq_21.booking__paid_at__extract_doy + , subq_21.metric_time__week + , subq_21.metric_time__month + , subq_21.metric_time__quarter + , subq_21.metric_time__year + , subq_21.metric_time__extract_year + , subq_21.metric_time__extract_quarter + , subq_21.metric_time__extract_month + , subq_21.metric_time__extract_day + , subq_21.metric_time__extract_dow + , subq_21.metric_time__extract_doy , subq_21.listing , subq_21.guest , subq_21.host @@ -736,16 +736,6 @@ FROM ( SELECT subq_20.country_latest AS listing__country_latest , subq_17.metric_time__day AS metric_time__day - , subq_17.metric_time__week AS metric_time__week - , subq_17.metric_time__month AS metric_time__month - , subq_17.metric_time__quarter AS metric_time__quarter - , subq_17.metric_time__year AS metric_time__year - , subq_17.metric_time__extract_year AS metric_time__extract_year - , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_17.metric_time__extract_month AS metric_time__extract_month - , subq_17.metric_time__extract_day AS metric_time__extract_day - , subq_17.metric_time__extract_dow AS metric_time__extract_dow - , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.ds__day AS ds__day , subq_17.ds__week AS ds__week , subq_17.ds__month AS ds__month @@ -812,6 +802,16 @@ FROM ( , subq_17.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_17.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_17.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_17.metric_time__week AS metric_time__week + , subq_17.metric_time__month AS metric_time__month + , subq_17.metric_time__quarter AS metric_time__quarter + , subq_17.metric_time__year AS metric_time__year + , subq_17.metric_time__extract_year AS metric_time__extract_year + , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_17.metric_time__extract_month AS metric_time__extract_month + , subq_17.metric_time__extract_day AS metric_time__extract_day + , subq_17.metric_time__extract_dow AS metric_time__extract_dow + , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.listing AS listing , subq_17.guest AS guest , subq_17.host AS host @@ -837,16 +837,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_15.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_15.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_15.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_15.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_15.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_15.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_15.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_15.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_15.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_15.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_15.metric_time__day) AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -913,6 +903,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Snowflake/test_offset_metric_with_query_time_filters__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Snowflake/test_offset_metric_with_query_time_filters__plan0.sql index ff34039aa..7083f023f 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Snowflake/test_offset_metric_with_query_time_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Snowflake/test_offset_metric_with_query_time_filters__plan0.sql @@ -606,16 +606,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_18.metric_time__day - , subq_18.metric_time__week - , subq_18.metric_time__month - , subq_18.metric_time__quarter - , subq_18.metric_time__year - , subq_18.metric_time__extract_year - , subq_18.metric_time__extract_quarter - , subq_18.metric_time__extract_month - , subq_18.metric_time__extract_day - , subq_18.metric_time__extract_dow - , subq_18.metric_time__extract_doy , subq_18.ds__day , subq_18.ds__week , subq_18.ds__month @@ -682,6 +672,16 @@ FROM ( , subq_18.booking__paid_at__extract_day , subq_18.booking__paid_at__extract_dow , subq_18.booking__paid_at__extract_doy + , subq_18.metric_time__week + , subq_18.metric_time__month + , subq_18.metric_time__quarter + , subq_18.metric_time__year + , subq_18.metric_time__extract_year + , subq_18.metric_time__extract_quarter + , subq_18.metric_time__extract_month + , subq_18.metric_time__extract_day + , subq_18.metric_time__extract_dow + , subq_18.metric_time__extract_doy , subq_18.listing , subq_18.guest , subq_18.host @@ -709,16 +709,6 @@ FROM ( SELECT subq_17.country_latest AS listing__country_latest , subq_14.metric_time__day AS metric_time__day - , subq_14.metric_time__week AS metric_time__week - , subq_14.metric_time__month AS metric_time__month - , subq_14.metric_time__quarter AS metric_time__quarter - , subq_14.metric_time__year AS metric_time__year - , subq_14.metric_time__extract_year AS metric_time__extract_year - , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_14.metric_time__extract_month AS metric_time__extract_month - , subq_14.metric_time__extract_day AS metric_time__extract_day - , subq_14.metric_time__extract_dow AS metric_time__extract_dow - , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -785,6 +775,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host @@ -810,16 +810,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_12.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_12.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_12.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_12.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_12.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_12.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_12.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_12.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_12.metric_time__day) AS metric_time__extract_day - , EXTRACT(dayofweekiso FROM subq_12.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_12.metric_time__day) AS metric_time__extract_doy , subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month @@ -886,6 +876,16 @@ FROM ( , subq_11.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_11.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_11.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_11.metric_time__week AS metric_time__week + , subq_11.metric_time__month AS metric_time__month + , subq_11.metric_time__quarter AS metric_time__quarter + , subq_11.metric_time__year AS metric_time__year + , subq_11.metric_time__extract_year AS metric_time__extract_year + , subq_11.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_11.metric_time__extract_month AS metric_time__extract_month + , subq_11.metric_time__extract_day AS metric_time__extract_day + , subq_11.metric_time__extract_dow AS metric_time__extract_dow + , subq_11.metric_time__extract_doy AS metric_time__extract_doy , subq_11.listing AS listing , subq_11.guest AS guest , subq_11.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Trino/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Trino/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql index 470312fbd..e4f3d7c56 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Trino/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Trino/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql @@ -633,16 +633,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_21.metric_time__day - , subq_21.metric_time__week - , subq_21.metric_time__month - , subq_21.metric_time__quarter - , subq_21.metric_time__year - , subq_21.metric_time__extract_year - , subq_21.metric_time__extract_quarter - , subq_21.metric_time__extract_month - , subq_21.metric_time__extract_day - , subq_21.metric_time__extract_dow - , subq_21.metric_time__extract_doy , subq_21.ds__day , subq_21.ds__week , subq_21.ds__month @@ -709,6 +699,16 @@ FROM ( , subq_21.booking__paid_at__extract_day , subq_21.booking__paid_at__extract_dow , subq_21.booking__paid_at__extract_doy + , subq_21.metric_time__week + , subq_21.metric_time__month + , subq_21.metric_time__quarter + , subq_21.metric_time__year + , subq_21.metric_time__extract_year + , subq_21.metric_time__extract_quarter + , subq_21.metric_time__extract_month + , subq_21.metric_time__extract_day + , subq_21.metric_time__extract_dow + , subq_21.metric_time__extract_doy , subq_21.listing , subq_21.guest , subq_21.host @@ -736,16 +736,6 @@ FROM ( SELECT subq_20.country_latest AS listing__country_latest , subq_17.metric_time__day AS metric_time__day - , subq_17.metric_time__week AS metric_time__week - , subq_17.metric_time__month AS metric_time__month - , subq_17.metric_time__quarter AS metric_time__quarter - , subq_17.metric_time__year AS metric_time__year - , subq_17.metric_time__extract_year AS metric_time__extract_year - , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_17.metric_time__extract_month AS metric_time__extract_month - , subq_17.metric_time__extract_day AS metric_time__extract_day - , subq_17.metric_time__extract_dow AS metric_time__extract_dow - , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.ds__day AS ds__day , subq_17.ds__week AS ds__week , subq_17.ds__month AS ds__month @@ -812,6 +802,16 @@ FROM ( , subq_17.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_17.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_17.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_17.metric_time__week AS metric_time__week + , subq_17.metric_time__month AS metric_time__month + , subq_17.metric_time__quarter AS metric_time__quarter + , subq_17.metric_time__year AS metric_time__year + , subq_17.metric_time__extract_year AS metric_time__extract_year + , subq_17.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_17.metric_time__extract_month AS metric_time__extract_month + , subq_17.metric_time__extract_day AS metric_time__extract_day + , subq_17.metric_time__extract_dow AS metric_time__extract_dow + , subq_17.metric_time__extract_doy AS metric_time__extract_doy , subq_17.listing AS listing , subq_17.guest AS guest , subq_17.host AS host @@ -837,16 +837,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_15.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_15.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_15.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_15.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_15.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_15.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_15.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_15.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_15.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_15.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_15.metric_time__day) AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -913,6 +903,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Trino/test_offset_metric_with_query_time_filters__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Trino/test_offset_metric_with_query_time_filters__plan0.sql index 2b83441e1..229c9671e 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Trino/test_offset_metric_with_query_time_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/Trino/test_offset_metric_with_query_time_filters__plan0.sql @@ -606,16 +606,6 @@ FROM ( -- Constrain Output with WHERE SELECT subq_18.metric_time__day - , subq_18.metric_time__week - , subq_18.metric_time__month - , subq_18.metric_time__quarter - , subq_18.metric_time__year - , subq_18.metric_time__extract_year - , subq_18.metric_time__extract_quarter - , subq_18.metric_time__extract_month - , subq_18.metric_time__extract_day - , subq_18.metric_time__extract_dow - , subq_18.metric_time__extract_doy , subq_18.ds__day , subq_18.ds__week , subq_18.ds__month @@ -682,6 +672,16 @@ FROM ( , subq_18.booking__paid_at__extract_day , subq_18.booking__paid_at__extract_dow , subq_18.booking__paid_at__extract_doy + , subq_18.metric_time__week + , subq_18.metric_time__month + , subq_18.metric_time__quarter + , subq_18.metric_time__year + , subq_18.metric_time__extract_year + , subq_18.metric_time__extract_quarter + , subq_18.metric_time__extract_month + , subq_18.metric_time__extract_day + , subq_18.metric_time__extract_dow + , subq_18.metric_time__extract_doy , subq_18.listing , subq_18.guest , subq_18.host @@ -709,16 +709,6 @@ FROM ( SELECT subq_17.country_latest AS listing__country_latest , subq_14.metric_time__day AS metric_time__day - , subq_14.metric_time__week AS metric_time__week - , subq_14.metric_time__month AS metric_time__month - , subq_14.metric_time__quarter AS metric_time__quarter - , subq_14.metric_time__year AS metric_time__year - , subq_14.metric_time__extract_year AS metric_time__extract_year - , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter - , subq_14.metric_time__extract_month AS metric_time__extract_month - , subq_14.metric_time__extract_day AS metric_time__extract_day - , subq_14.metric_time__extract_dow AS metric_time__extract_dow - , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month @@ -785,6 +775,16 @@ FROM ( , subq_14.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_14.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_14.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_14.metric_time__week AS metric_time__week + , subq_14.metric_time__month AS metric_time__month + , subq_14.metric_time__quarter AS metric_time__quarter + , subq_14.metric_time__year AS metric_time__year + , subq_14.metric_time__extract_year AS metric_time__extract_year + , subq_14.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_14.metric_time__extract_month AS metric_time__extract_month + , subq_14.metric_time__extract_day AS metric_time__extract_day + , subq_14.metric_time__extract_dow AS metric_time__extract_dow + , subq_14.metric_time__extract_doy AS metric_time__extract_doy , subq_14.listing AS listing , subq_14.guest AS guest , subq_14.host AS host @@ -810,16 +810,6 @@ FROM ( -- Join to Time Spine Dataset SELECT subq_12.metric_time__day AS metric_time__day - , DATE_TRUNC('week', subq_12.metric_time__day) AS metric_time__week - , DATE_TRUNC('month', subq_12.metric_time__day) AS metric_time__month - , DATE_TRUNC('quarter', subq_12.metric_time__day) AS metric_time__quarter - , DATE_TRUNC('year', subq_12.metric_time__day) AS metric_time__year - , EXTRACT(year FROM subq_12.metric_time__day) AS metric_time__extract_year - , EXTRACT(quarter FROM subq_12.metric_time__day) AS metric_time__extract_quarter - , EXTRACT(month FROM subq_12.metric_time__day) AS metric_time__extract_month - , EXTRACT(day FROM subq_12.metric_time__day) AS metric_time__extract_day - , EXTRACT(DAY_OF_WEEK FROM subq_12.metric_time__day) AS metric_time__extract_dow - , EXTRACT(doy FROM subq_12.metric_time__day) AS metric_time__extract_doy , subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month @@ -886,6 +876,16 @@ FROM ( , subq_11.booking__paid_at__extract_day AS booking__paid_at__extract_day , subq_11.booking__paid_at__extract_dow AS booking__paid_at__extract_dow , subq_11.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_11.metric_time__week AS metric_time__week + , subq_11.metric_time__month AS metric_time__month + , subq_11.metric_time__quarter AS metric_time__quarter + , subq_11.metric_time__year AS metric_time__year + , subq_11.metric_time__extract_year AS metric_time__extract_year + , subq_11.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_11.metric_time__extract_month AS metric_time__extract_month + , subq_11.metric_time__extract_day AS metric_time__extract_day + , subq_11.metric_time__extract_dow AS metric_time__extract_dow + , subq_11.metric_time__extract_doy AS metric_time__extract_doy , subq_11.listing AS listing , subq_11.guest AS guest , subq_11.host AS host