From b966ccc9e4502f367a3fe2843da92e777f5d75fa Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Thu, 21 Nov 2024 07:24:05 -0800 Subject: [PATCH] Update snapshots for other SQL engines --- ...dow_metric_with_non_default_grains__plan0.sql | 8 +++++--- ...dow_metric_with_non_default_grains__plan0.sql | 8 +++++--- ...dow_metric_with_non_default_grains__plan0.sql | 8 +++++--- ...dow_metric_with_non_default_grains__plan0.sql | 8 +++++--- ...dow_metric_with_non_default_grains__plan0.sql | 8 +++++--- ...dow_metric_with_non_default_grains__plan0.sql | 8 +++++--- ...set_metric_with_custom_granularity__plan0.sql | 4 ++-- ...granularity_filter_not_in_group_by__plan0.sql | 4 ++-- ...set_metric_with_custom_granularity__plan0.sql | 4 ++-- ...granularity_filter_not_in_group_by__plan0.sql | 4 ++-- ...set_metric_with_custom_granularity__plan0.sql | 4 ++-- ...granularity_filter_not_in_group_by__plan0.sql | 4 ++-- ...set_metric_with_custom_granularity__plan0.sql | 4 ++-- ...granularity_filter_not_in_group_by__plan0.sql | 4 ++-- ...set_metric_with_custom_granularity__plan0.sql | 4 ++-- ...granularity_filter_not_in_group_by__plan0.sql | 4 ++-- ...set_metric_with_custom_granularity__plan0.sql | 4 ++-- ...granularity_filter_not_in_group_by__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ..._month_dimension_and_offset_window__plan0.sql | 4 ++-- ...erived_metric_with_offset_to_grain__plan0.sql | 4 ++-- ...th_offset_to_grain_and_granularity__plan0.sql | 9 +++++---- ..._derived_metric_with_offset_window__plan0.sql | 4 ++-- ...with_offset_window_and_granularity__plan0.sql | 7 ++++--- ..._offset_window_and_offset_to_grain__plan0.sql | 8 ++++---- ...nd_offset_to_grain_and_granularity__plan0.sql | 16 +++++++++------- ...with_offset_window_and_time_filter__plan0.sql | 4 ++-- ...t_derived_offset_cumulative_metric__plan0.sql | 4 ++-- ...ed_offset_metric_with_agg_time_dim__plan0.sql | 4 ++-- ...ffset_metric_with_one_input_metric__plan0.sql | 4 ++-- ...ined_where_constraint_not_selected__plan0.sql | 4 ++-- .../BigQuery/test_nested_offsets__plan0.sql | 4 ++-- ...ested_offsets_with_time_constraint__plan0.sql | 4 ++-- ...sted_offsets_with_where_constraint__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 13 +++++++------ ..._different_granularities__plan0_optimized.sql | 4 ++-- ...rain_metric_multiple_granularities__plan0.sql | 10 ++++++---- ..._offset_to_grain_with_agg_time_dim__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 11 ++++++----- ..._different_granularities__plan0_optimized.sql | 4 ++-- ...ndow_metric_multiple_granularities__plan0.sql | 10 ++++++---- ...st_offset_window_with_agg_time_dim__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ..._month_dimension_and_offset_window__plan0.sql | 4 ++-- ...erived_metric_with_offset_to_grain__plan0.sql | 4 ++-- ...th_offset_to_grain_and_granularity__plan0.sql | 9 +++++---- ..._derived_metric_with_offset_window__plan0.sql | 4 ++-- ...with_offset_window_and_granularity__plan0.sql | 7 ++++--- ..._offset_window_and_offset_to_grain__plan0.sql | 8 ++++---- ...nd_offset_to_grain_and_granularity__plan0.sql | 16 +++++++++------- ...with_offset_window_and_time_filter__plan0.sql | 4 ++-- ...t_derived_offset_cumulative_metric__plan0.sql | 4 ++-- ...ed_offset_metric_with_agg_time_dim__plan0.sql | 4 ++-- ...ffset_metric_with_one_input_metric__plan0.sql | 4 ++-- ...ined_where_constraint_not_selected__plan0.sql | 4 ++-- .../Databricks/test_nested_offsets__plan0.sql | 4 ++-- ...ested_offsets_with_time_constraint__plan0.sql | 4 ++-- ...sted_offsets_with_where_constraint__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 13 +++++++------ ..._different_granularities__plan0_optimized.sql | 4 ++-- ...rain_metric_multiple_granularities__plan0.sql | 10 ++++++---- ..._offset_to_grain_with_agg_time_dim__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 11 ++++++----- ..._different_granularities__plan0_optimized.sql | 4 ++-- ...ndow_metric_multiple_granularities__plan0.sql | 10 ++++++---- ...st_offset_window_with_agg_time_dim__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ..._month_dimension_and_offset_window__plan0.sql | 4 ++-- ...erived_metric_with_offset_to_grain__plan0.sql | 4 ++-- ...th_offset_to_grain_and_granularity__plan0.sql | 9 +++++---- ..._derived_metric_with_offset_window__plan0.sql | 4 ++-- ...with_offset_window_and_granularity__plan0.sql | 7 ++++--- ..._offset_window_and_offset_to_grain__plan0.sql | 8 ++++---- ...nd_offset_to_grain_and_granularity__plan0.sql | 16 +++++++++------- ...with_offset_window_and_time_filter__plan0.sql | 4 ++-- ...t_derived_offset_cumulative_metric__plan0.sql | 4 ++-- ...ed_offset_metric_with_agg_time_dim__plan0.sql | 4 ++-- ...ffset_metric_with_one_input_metric__plan0.sql | 4 ++-- ...ined_where_constraint_not_selected__plan0.sql | 4 ++-- .../Postgres/test_nested_offsets__plan0.sql | 4 ++-- ...ested_offsets_with_time_constraint__plan0.sql | 4 ++-- ...sted_offsets_with_where_constraint__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 13 +++++++------ ..._different_granularities__plan0_optimized.sql | 4 ++-- ...rain_metric_multiple_granularities__plan0.sql | 10 ++++++---- ..._offset_to_grain_with_agg_time_dim__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 11 ++++++----- ..._different_granularities__plan0_optimized.sql | 4 ++-- ...ndow_metric_multiple_granularities__plan0.sql | 10 ++++++---- ...st_offset_window_with_agg_time_dim__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ..._month_dimension_and_offset_window__plan0.sql | 4 ++-- ...erived_metric_with_offset_to_grain__plan0.sql | 4 ++-- ...th_offset_to_grain_and_granularity__plan0.sql | 9 +++++---- ..._derived_metric_with_offset_window__plan0.sql | 4 ++-- ...with_offset_window_and_granularity__plan0.sql | 7 ++++--- ..._offset_window_and_offset_to_grain__plan0.sql | 8 ++++---- ...nd_offset_to_grain_and_granularity__plan0.sql | 16 +++++++++------- ...with_offset_window_and_time_filter__plan0.sql | 4 ++-- ...t_derived_offset_cumulative_metric__plan0.sql | 4 ++-- ...ed_offset_metric_with_agg_time_dim__plan0.sql | 4 ++-- ...ffset_metric_with_one_input_metric__plan0.sql | 4 ++-- ...ined_where_constraint_not_selected__plan0.sql | 4 ++-- .../Redshift/test_nested_offsets__plan0.sql | 4 ++-- ...ested_offsets_with_time_constraint__plan0.sql | 4 ++-- ...sted_offsets_with_where_constraint__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 13 +++++++------ ..._different_granularities__plan0_optimized.sql | 4 ++-- ...rain_metric_multiple_granularities__plan0.sql | 10 ++++++---- ..._offset_to_grain_with_agg_time_dim__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 11 ++++++----- ..._different_granularities__plan0_optimized.sql | 4 ++-- ...ndow_metric_multiple_granularities__plan0.sql | 10 ++++++---- ...st_offset_window_with_agg_time_dim__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ..._month_dimension_and_offset_window__plan0.sql | 4 ++-- ...erived_metric_with_offset_to_grain__plan0.sql | 4 ++-- ...th_offset_to_grain_and_granularity__plan0.sql | 9 +++++---- ..._derived_metric_with_offset_window__plan0.sql | 4 ++-- ...with_offset_window_and_granularity__plan0.sql | 7 ++++--- ..._offset_window_and_offset_to_grain__plan0.sql | 8 ++++---- ...nd_offset_to_grain_and_granularity__plan0.sql | 16 +++++++++------- ...with_offset_window_and_time_filter__plan0.sql | 4 ++-- ...t_derived_offset_cumulative_metric__plan0.sql | 4 ++-- ...ed_offset_metric_with_agg_time_dim__plan0.sql | 4 ++-- ...ffset_metric_with_one_input_metric__plan0.sql | 4 ++-- ...ined_where_constraint_not_selected__plan0.sql | 4 ++-- .../Snowflake/test_nested_offsets__plan0.sql | 4 ++-- ...ested_offsets_with_time_constraint__plan0.sql | 4 ++-- ...sted_offsets_with_where_constraint__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 13 +++++++------ ..._different_granularities__plan0_optimized.sql | 4 ++-- ...rain_metric_multiple_granularities__plan0.sql | 10 ++++++---- ..._offset_to_grain_with_agg_time_dim__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 11 ++++++----- ..._different_granularities__plan0_optimized.sql | 4 ++-- ...ndow_metric_multiple_granularities__plan0.sql | 10 ++++++---- ...st_offset_window_with_agg_time_dim__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ..._month_dimension_and_offset_window__plan0.sql | 4 ++-- ...erived_metric_with_offset_to_grain__plan0.sql | 4 ++-- ...th_offset_to_grain_and_granularity__plan0.sql | 9 +++++---- ..._derived_metric_with_offset_window__plan0.sql | 4 ++-- ...with_offset_window_and_granularity__plan0.sql | 7 ++++--- ..._offset_window_and_offset_to_grain__plan0.sql | 8 ++++---- ...nd_offset_to_grain_and_granularity__plan0.sql | 16 +++++++++------- ...with_offset_window_and_time_filter__plan0.sql | 4 ++-- ...t_derived_offset_cumulative_metric__plan0.sql | 4 ++-- ...ed_offset_metric_with_agg_time_dim__plan0.sql | 4 ++-- ...ffset_metric_with_one_input_metric__plan0.sql | 4 ++-- ...ined_where_constraint_not_selected__plan0.sql | 4 ++-- .../Trino/test_nested_offsets__plan0.sql | 4 ++-- ...ested_offsets_with_time_constraint__plan0.sql | 4 ++-- ...sted_offsets_with_where_constraint__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 13 +++++++------ ..._different_granularities__plan0_optimized.sql | 4 ++-- ...rain_metric_multiple_granularities__plan0.sql | 10 ++++++---- ..._offset_to_grain_with_agg_time_dim__plan0.sql | 4 ++-- ...query_have_different_granularities__plan0.sql | 11 ++++++----- ..._different_granularities__plan0_optimized.sql | 4 ++-- ...ndow_metric_multiple_granularities__plan0.sql | 10 ++++++---- ...st_offset_window_with_agg_time_dim__plan0.sql | 4 ++-- ...offset_metric_with_time_constraint__plan0.sql | 4 ++-- ...ed_fill_nulls_for_one_input_metric__plan0.sql | 4 ++-- ...ter_not_in_group_by_using_agg_time__plan0.sql | 2 +- ..._group_by_using_agg_time__plan0_optimized.sql | 2 +- ..._by_using_agg_time_and_metric_time__plan0.sql | 4 ++-- ...agg_time_and_metric_time__plan0_optimized.sql | 4 ++-- ..._with_filter_smaller_than_group_by__plan0.sql | 4 ++-- ...er_smaller_than_group_by__plan0_optimized.sql | 4 ++-- ...ed_fill_nulls_for_one_input_metric__plan0.sql | 4 ++-- ...ter_not_in_group_by_using_agg_time__plan0.sql | 2 +- ..._group_by_using_agg_time__plan0_optimized.sql | 2 +- ..._by_using_agg_time_and_metric_time__plan0.sql | 4 ++-- ...agg_time_and_metric_time__plan0_optimized.sql | 4 ++-- ..._with_filter_smaller_than_group_by__plan0.sql | 4 ++-- ...er_smaller_than_group_by__plan0_optimized.sql | 4 ++-- ...ed_fill_nulls_for_one_input_metric__plan0.sql | 4 ++-- ...ter_not_in_group_by_using_agg_time__plan0.sql | 2 +- ..._group_by_using_agg_time__plan0_optimized.sql | 2 +- ..._by_using_agg_time_and_metric_time__plan0.sql | 4 ++-- ...agg_time_and_metric_time__plan0_optimized.sql | 4 ++-- ..._with_filter_smaller_than_group_by__plan0.sql | 4 ++-- ...er_smaller_than_group_by__plan0_optimized.sql | 4 ++-- ...ed_fill_nulls_for_one_input_metric__plan0.sql | 4 ++-- ...ter_not_in_group_by_using_agg_time__plan0.sql | 2 +- ..._group_by_using_agg_time__plan0_optimized.sql | 2 +- ..._by_using_agg_time_and_metric_time__plan0.sql | 4 ++-- ...agg_time_and_metric_time__plan0_optimized.sql | 4 ++-- ..._with_filter_smaller_than_group_by__plan0.sql | 4 ++-- ...er_smaller_than_group_by__plan0_optimized.sql | 4 ++-- ...ed_fill_nulls_for_one_input_metric__plan0.sql | 4 ++-- ...ter_not_in_group_by_using_agg_time__plan0.sql | 2 +- ..._group_by_using_agg_time__plan0_optimized.sql | 2 +- ..._by_using_agg_time_and_metric_time__plan0.sql | 4 ++-- ...agg_time_and_metric_time__plan0_optimized.sql | 4 ++-- ..._with_filter_smaller_than_group_by__plan0.sql | 4 ++-- ...er_smaller_than_group_by__plan0_optimized.sql | 4 ++-- ...ed_fill_nulls_for_one_input_metric__plan0.sql | 4 ++-- ...ter_not_in_group_by_using_agg_time__plan0.sql | 2 +- ..._group_by_using_agg_time__plan0_optimized.sql | 2 +- ..._by_using_agg_time_and_metric_time__plan0.sql | 4 ++-- ...agg_time_and_metric_time__plan0_optimized.sql | 4 ++-- ..._with_filter_smaller_than_group_by__plan0.sql | 4 ++-- ...er_smaller_than_group_by__plan0_optimized.sql | 4 ++-- .../test_offset_window_with_date_part__plan0.sql | 7 ++++--- ...st_subdaily_offset_to_grain_metric__plan0.sql | 4 ++-- ...test_subdaily_offset_window_metric__plan0.sql | 4 ++-- .../test_offset_window_with_date_part__plan0.sql | 7 ++++--- ...st_subdaily_offset_to_grain_metric__plan0.sql | 4 ++-- ...test_subdaily_offset_window_metric__plan0.sql | 4 ++-- .../test_offset_window_with_date_part__plan0.sql | 7 ++++--- ...st_subdaily_offset_to_grain_metric__plan0.sql | 4 ++-- ...test_subdaily_offset_window_metric__plan0.sql | 4 ++-- .../test_offset_window_with_date_part__plan0.sql | 7 ++++--- ...st_subdaily_offset_to_grain_metric__plan0.sql | 4 ++-- ...test_subdaily_offset_window_metric__plan0.sql | 4 ++-- .../test_offset_window_with_date_part__plan0.sql | 7 ++++--- ...st_subdaily_offset_to_grain_metric__plan0.sql | 4 ++-- ...test_subdaily_offset_window_metric__plan0.sql | 4 ++-- .../test_offset_window_with_date_part__plan0.sql | 7 ++++--- ...st_subdaily_offset_to_grain_metric__plan0.sql | 4 ++-- ...test_subdaily_offset_window_metric__plan0.sql | 4 ++-- ...me_spine_metric_predicate_pushdown__plan0.sql | 4 ++-- ...set_metric_with_query_time_filters__plan0.sql | 4 ++-- ...me_spine_metric_predicate_pushdown__plan0.sql | 4 ++-- ...set_metric_with_query_time_filters__plan0.sql | 4 ++-- ...me_spine_metric_predicate_pushdown__plan0.sql | 4 ++-- ...set_metric_with_query_time_filters__plan0.sql | 4 ++-- ...me_spine_metric_predicate_pushdown__plan0.sql | 4 ++-- ...set_metric_with_query_time_filters__plan0.sql | 4 ++-- ...me_spine_metric_predicate_pushdown__plan0.sql | 4 ++-- ...set_metric_with_query_time_filters__plan0.sql | 4 ++-- ...me_spine_metric_predicate_pushdown__plan0.sql | 4 ++-- ...set_metric_with_query_time_filters__plan0.sql | 4 ++-- 240 files changed, 684 insertions(+), 606 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 983896334..5d8666ab8 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 @@ -33,14 +33,16 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATETIME_TRUNC(subq_7.metric_time__day, month) AS booking__ds__month + subq_7.booking__ds__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_7.metric_time__week AS metric_time__week , subq_6.bookers AS bookers FROM ( -- Time Spine SELECT - subq_8.ds AS metric_time__day + DATETIME_TRUNC(subq_8.ds, month) AS booking__ds__month + , subq_8.ds AS metric_time__day + , DATETIME_TRUNC(subq_8.ds, isoweek) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 LEFT OUTER JOIN ( 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 6c8eaceb9..a4739c508 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 @@ -33,14 +33,16 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_7.metric_time__day) AS booking__ds__month + subq_7.booking__ds__month 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_7.metric_time__week AS metric_time__week , subq_6.bookers AS bookers FROM ( -- Time Spine SELECT - subq_8.ds AS metric_time__day + DATE_TRUNC('month', subq_8.ds) AS booking__ds__month + , subq_8.ds AS metric_time__day + , DATE_TRUNC('week', subq_8.ds) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 LEFT OUTER JOIN ( 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 e1cf8da44..f56a6eefe 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 @@ -33,14 +33,16 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_7.metric_time__day) AS booking__ds__month + subq_7.booking__ds__month 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_7.metric_time__week AS metric_time__week , subq_6.bookers AS bookers FROM ( -- Time Spine SELECT - subq_8.ds AS metric_time__day + DATE_TRUNC('month', subq_8.ds) AS booking__ds__month + , subq_8.ds AS metric_time__day + , DATE_TRUNC('week', subq_8.ds) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 LEFT OUTER JOIN ( 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 920c847ed..254f0ffd6 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 @@ -33,14 +33,16 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_7.metric_time__day) AS booking__ds__month + subq_7.booking__ds__month 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_7.metric_time__week AS metric_time__week , subq_6.bookers AS bookers FROM ( -- Time Spine SELECT - subq_8.ds AS metric_time__day + DATE_TRUNC('month', subq_8.ds) AS booking__ds__month + , subq_8.ds AS metric_time__day + , DATE_TRUNC('week', subq_8.ds) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 LEFT OUTER JOIN ( 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 9cdae4011..765a4c8d6 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 @@ -33,14 +33,16 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_7.metric_time__day) AS booking__ds__month + subq_7.booking__ds__month 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_7.metric_time__week AS metric_time__week , subq_6.bookers AS bookers FROM ( -- Time Spine SELECT - subq_8.ds AS metric_time__day + DATE_TRUNC('month', subq_8.ds) AS booking__ds__month + , subq_8.ds AS metric_time__day + , DATE_TRUNC('week', subq_8.ds) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 LEFT OUTER JOIN ( 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 440b3e427..885b36d4a 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 @@ -33,14 +33,16 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_7.metric_time__day) AS booking__ds__month + subq_7.booking__ds__month 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_7.metric_time__week AS metric_time__week , subq_6.bookers AS bookers FROM ( -- Time Spine SELECT - subq_8.ds AS metric_time__day + DATE_TRUNC('month', subq_8.ds) AS booking__ds__month + , subq_8.ds AS metric_time__day + , DATE_TRUNC('week', subq_8.ds) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 LEFT OUTER JOIN ( 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 6f44b7dd3..44e316434 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 @@ -25,8 +25,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -102,6 +101,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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/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 28c4d122e..e1e167d6d 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 @@ -127,8 +127,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -204,6 +203,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 7d623cb6e..d257d3c95 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 @@ -25,8 +25,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -102,6 +101,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 ac0ae630e..af61ddd1a 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 @@ -127,8 +127,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -204,6 +203,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 e1141a251..4f13c6801 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 @@ -25,8 +25,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -102,6 +101,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 8f4617d28..b1d1cd370 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 @@ -127,8 +127,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -204,6 +203,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 f79cb4c36..f89b8107c 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 @@ -25,8 +25,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -102,6 +101,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 45f2fbc06..eb358f719 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 @@ -127,8 +127,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -204,6 +203,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 6a98a77a1..910d646a8 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 @@ -25,8 +25,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -102,6 +101,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 58a022c87..2e48ef16a 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 @@ -127,8 +127,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -204,6 +203,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 c0e42d0d6..e62be1818 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 @@ -25,8 +25,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -102,6 +101,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 6ddbbbdaf..d3230164e 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 @@ -127,8 +127,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -204,6 +203,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 e28bc9828..3e4406e1c 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 @@ -125,8 +125,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -202,6 +201,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 aa69ae70d..119fab4c8 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__month AS metric_time__month - , subq_1.ds__month AS ds__month + subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year , subq_1.ds__extract_year AS ds__extract_year @@ -42,6 +41,7 @@ FROM ( , 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_2.metric_time__month AS metric_time__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 766c84131..065606865 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 f4c27482d..1e5820383 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATETIME_TRUNC(subq_7.metric_time__day, isoweek) AS metric_time__week - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__week AS metric_time__week , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATETIME_TRUNC(subq_8.ds, isoweek) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( @@ -546,7 +547,7 @@ FROM ( ) subq_6 ON DATETIME_TRUNC(subq_7.metric_time__day, month) = subq_6.metric_time__day - WHERE DATETIME_TRUNC(subq_7.metric_time__day, isoweek) = subq_7.metric_time__day + WHERE subq_7.metric_time__week = subq_7.metric_time__day ) subq_9 ) subq_10 GROUP BY 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 4315352dd..3f7191f5d 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 8dab694d7..5ec8661cc 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATETIME_TRUNC(subq_7.metric_time__day, quarter) AS metric_time__quarter - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__quarter AS metric_time__quarter , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATETIME_TRUNC(subq_8.ds, quarter) AS metric_time__quarter FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 e2891b8c7..fc0248f2d 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -355,8 +355,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -432,6 +431,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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 801310a99..46b2d4938 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,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -97,7 +96,6 @@ 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 @@ -107,6 +105,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -132,6 +132,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATETIME_TRUNC(subq_3.ds, year) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -331,7 +332,7 @@ FROM ( ) subq_1 ON DATETIME_TRUNC(subq_2.metric_time__day, month) = subq_1.metric_time__day - WHERE DATETIME_TRUNC(subq_2.metric_time__day, year) = subq_2.metric_time__day + WHERE subq_2.metric_time__year = subq_2.metric_time__day ) subq_4 ) subq_5 GROUP BY @@ -356,8 +357,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATETIME_TRUNC(subq_10.metric_time__day, year) AS metric_time__year - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -423,7 +423,6 @@ 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 @@ -433,6 +432,8 @@ FROM ( , 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_10.metric_time__day AS metric_time__day + , subq_10.metric_time__year AS metric_time__year , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -458,6 +459,7 @@ FROM ( -- Time Spine SELECT subq_11.ds AS metric_time__day + , DATETIME_TRUNC(subq_11.ds, year) AS metric_time__year FROM ***************************.mf_time_spine subq_11 ) subq_10 INNER JOIN ( 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 381f3d287..7dffd3b11 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 @@ -449,8 +449,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day AS metric_time__day - , subq_7.ds__day AS ds__day + subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month , subq_7.ds__quarter AS ds__quarter @@ -526,6 +525,7 @@ FROM ( , 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_8.metric_time__day AS metric_time__day , 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 c9c070bfe..de1eeb41d 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 c4a927f4a..d8780ac0a 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 a95c8aa4e..df0e0ec4b 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 325401084..f530cf5bd 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 @@ -56,8 +56,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -133,6 +132,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 a1f9b0034..8dabbb665 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 @@ -40,8 +40,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -117,6 +116,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 3525bf5d9..f24a17fee 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 @@ -41,8 +41,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -118,6 +117,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 d368d1cc0..61afaecba 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 @@ -45,8 +45,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -122,6 +121,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 3f77db76a..18e866aa3 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,7 +26,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -93,7 +94,6 @@ 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 @@ -127,8 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -194,7 +193,6 @@ 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 @@ -204,6 +202,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -229,6 +229,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATETIME_TRUNC(subq_3.ds, month) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -428,7 +429,7 @@ FROM ( ) subq_1 ON DATETIME_TRUNC(subq_2.metric_time__day, month) = subq_1.metric_time__day - WHERE DATETIME_TRUNC(subq_2.metric_time__day, month) = subq_2.metric_time__day + WHERE subq_2.metric_time__month = subq_2.metric_time__day ) subq_4 WHERE metric_time__day = '2020-01-01' ) subq_5 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 bce15e070..9b2141086 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 - DATETIME_TRUNC(subq_12.ds, month) AS metric_time__month - , subq_10.metric_time__day AS metric_time__day + subq_12.ds AS metric_time__day + , DATETIME_TRUNC(subq_12.ds, month) AS metric_time__month , 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 a83cd1f6d..9918514a5 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 @@ -34,10 +34,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, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -111,6 +108,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -136,6 +136,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATETIME_TRUNC(subq_3.ds, month) AS metric_time__month + , DATETIME_TRUNC(subq_3.ds, year) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 df697c26c..2d0d21a19 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 8c53a7d0a..391f0260e 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,7 +32,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -99,7 +100,6 @@ 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 @@ -133,8 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATETIME_TRUNC(subq_2.metric_time__day, month) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -200,7 +199,6 @@ 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 @@ -210,6 +208,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -235,6 +235,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATETIME_TRUNC(subq_3.ds, month) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 f58300038..73536fe94 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 - DATETIME_TRUNC(subq_19.ds, month) AS metric_time__month - , DATETIME_TRUNC(bookings_source_src_28000.ds, day) AS metric_time__day + subq_19.ds AS metric_time__day + , DATETIME_TRUNC(subq_19.ds, month) AS metric_time__month , 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 ae94bb921..29b963015 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 @@ -42,10 +42,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, month) AS metric_time__month - , DATETIME_TRUNC(subq_2.metric_time__day, year) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -119,6 +116,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -144,6 +144,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATETIME_TRUNC(subq_3.ds, month) AS metric_time__month + , DATETIME_TRUNC(subq_3.ds, year) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 20dfb7835..d0c40b979 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 cd4f97213..514d3903b 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 16ffa2692..82da009ac 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 @@ -125,8 +125,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -202,6 +201,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 5acb3e5d8..eafb170fe 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__month AS metric_time__month - , subq_1.ds__month AS ds__month + subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year , subq_1.ds__extract_year AS ds__extract_year @@ -42,6 +41,7 @@ FROM ( , 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_2.metric_time__month AS metric_time__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 7d7aa9351..3af864b14 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 f792d1ab0..e560cf8f8 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__week AS metric_time__week , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATE_TRUNC('week', subq_8.ds) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( @@ -546,7 +547,7 @@ FROM ( ) subq_6 ON DATE_TRUNC('month', subq_7.metric_time__day) = subq_6.metric_time__day - WHERE DATE_TRUNC('week', subq_7.metric_time__day) = subq_7.metric_time__day + WHERE subq_7.metric_time__week = subq_7.metric_time__day ) subq_9 ) subq_10 GROUP BY 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 fdd749b31..511b679c6 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 afb647f8a..60632e4c6 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__quarter AS metric_time__quarter , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATE_TRUNC('quarter', subq_8.ds) AS metric_time__quarter FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 d4ade9d2b..73da41edd 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -355,8 +355,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -432,6 +431,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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 e8324ba7d..34b136fca 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,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -97,7 +96,6 @@ 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 @@ -107,6 +105,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -132,6 +132,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -331,7 +332,7 @@ FROM ( ) subq_1 ON DATE_TRUNC('month', subq_2.metric_time__day) = subq_1.metric_time__day - WHERE DATE_TRUNC('year', subq_2.metric_time__day) = subq_2.metric_time__day + WHERE subq_2.metric_time__year = subq_2.metric_time__day ) subq_4 ) subq_5 GROUP BY @@ -356,8 +357,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -423,7 +423,6 @@ 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 @@ -433,6 +432,8 @@ FROM ( , 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_10.metric_time__day AS metric_time__day + , subq_10.metric_time__year AS metric_time__year , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -458,6 +459,7 @@ FROM ( -- Time Spine SELECT subq_11.ds AS metric_time__day + , DATE_TRUNC('year', subq_11.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_11 ) subq_10 INNER JOIN ( 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 f4c919e27..efc616c1f 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 @@ -449,8 +449,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day AS metric_time__day - , subq_7.ds__day AS ds__day + subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month , subq_7.ds__quarter AS ds__quarter @@ -526,6 +525,7 @@ FROM ( , 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_8.metric_time__day AS metric_time__day , 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 7a88f67b6..bf9a364f7 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 8ca19b100..d5504de0f 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 ccaa3b6c4..2ac85d5e5 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 730fca211..a2e8049a0 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 @@ -56,8 +56,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -133,6 +132,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 94457a2be..c4b46c6b6 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 @@ -40,8 +40,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -117,6 +116,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 a3777e103..65c996a51 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 @@ -41,8 +41,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -118,6 +117,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 78c8f98e7..e0695c7c0 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 @@ -45,8 +45,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -122,6 +121,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 b3388e8d1..f66c0d336 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,7 +26,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -93,7 +94,6 @@ 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 @@ -127,8 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -194,7 +193,6 @@ 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 @@ -204,6 +202,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -229,6 +229,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -428,7 +429,7 @@ FROM ( ) subq_1 ON DATE_TRUNC('month', subq_2.metric_time__day) = subq_1.metric_time__day - WHERE DATE_TRUNC('month', subq_2.metric_time__day) = subq_2.metric_time__day + WHERE subq_2.metric_time__month = subq_2.metric_time__day ) subq_4 WHERE metric_time__day = '2020-01-01' ) subq_5 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 6a4dc6cff..a45feb035 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 - DATE_TRUNC('month', subq_12.ds) AS metric_time__month - , subq_10.metric_time__day AS metric_time__day + subq_12.ds AS metric_time__day + , DATE_TRUNC('month', subq_12.ds) AS metric_time__month , 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 46a7954ae..e8fa5025e 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 @@ -34,10 +34,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -111,6 +108,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -136,6 +136,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 8c63963df..b29006bc3 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 7572575e6..eed8eb0a5 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,7 +32,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -99,7 +100,6 @@ 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 @@ -133,8 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -200,7 +199,6 @@ 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 @@ -210,6 +208,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -235,6 +235,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 64709ee44..0acbd8cac 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 - DATE_TRUNC('month', subq_19.ds) AS metric_time__month - , DATE_TRUNC('day', bookings_source_src_28000.ds) AS metric_time__day + subq_19.ds AS metric_time__day + , DATE_TRUNC('month', subq_19.ds) AS metric_time__month , 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 3977f5cb7..f23e68bc4 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 @@ -42,10 +42,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -119,6 +116,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -144,6 +144,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 b8b961e7b..28f94b9e4 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 5176f8516..4e3006f03 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 e7a776d64..f0d293156 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 @@ -125,8 +125,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -202,6 +201,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 93ebb3135..750ff9063 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__month AS metric_time__month - , subq_1.ds__month AS ds__month + subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year , subq_1.ds__extract_year AS ds__extract_year @@ -42,6 +41,7 @@ FROM ( , 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_2.metric_time__month AS metric_time__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 e25a0010f..0683f8720 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 2111c8945..5d21e0363 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__week AS metric_time__week , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATE_TRUNC('week', subq_8.ds) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( @@ -546,7 +547,7 @@ FROM ( ) subq_6 ON DATE_TRUNC('month', subq_7.metric_time__day) = subq_6.metric_time__day - WHERE DATE_TRUNC('week', subq_7.metric_time__day) = subq_7.metric_time__day + WHERE subq_7.metric_time__week = subq_7.metric_time__day ) subq_9 ) subq_10 GROUP BY 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 2d15542c6..74e365f02 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 2344dcc31..642f5ffb8 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__quarter AS metric_time__quarter , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATE_TRUNC('quarter', subq_8.ds) AS metric_time__quarter FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 7ae1d2eb4..d7dae6baa 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -355,8 +355,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -432,6 +431,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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 9a4536780..132c0f40c 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,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -97,7 +96,6 @@ 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 @@ -107,6 +105,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -132,6 +132,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -331,7 +332,7 @@ FROM ( ) subq_1 ON DATE_TRUNC('month', subq_2.metric_time__day) = subq_1.metric_time__day - WHERE DATE_TRUNC('year', subq_2.metric_time__day) = subq_2.metric_time__day + WHERE subq_2.metric_time__year = subq_2.metric_time__day ) subq_4 ) subq_5 GROUP BY @@ -356,8 +357,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -423,7 +423,6 @@ 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 @@ -433,6 +432,8 @@ FROM ( , 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_10.metric_time__day AS metric_time__day + , subq_10.metric_time__year AS metric_time__year , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -458,6 +459,7 @@ FROM ( -- Time Spine SELECT subq_11.ds AS metric_time__day + , DATE_TRUNC('year', subq_11.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_11 ) subq_10 INNER JOIN ( 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 4f7ecf502..ced1e2601 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 @@ -449,8 +449,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day AS metric_time__day - , subq_7.ds__day AS ds__day + subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month , subq_7.ds__quarter AS ds__quarter @@ -526,6 +525,7 @@ FROM ( , 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_8.metric_time__day AS metric_time__day , 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 eea894032..d18853ba2 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 a07f9018a..0c81710c4 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 22f7060c2..0fc68fcd6 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 221f93ec2..6ed48b65c 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 @@ -56,8 +56,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -133,6 +132,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 36df5e99e..90ba8589c 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 @@ -40,8 +40,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -117,6 +116,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 f75ae7237..bf90f23c6 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 @@ -41,8 +41,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -118,6 +117,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 7b4679dfb..a4d455fe3 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 @@ -45,8 +45,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -122,6 +121,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 b88fd360e..b5f368c48 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,7 +26,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -93,7 +94,6 @@ 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 @@ -127,8 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -194,7 +193,6 @@ 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 @@ -204,6 +202,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -229,6 +229,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -428,7 +429,7 @@ FROM ( ) subq_1 ON DATE_TRUNC('month', subq_2.metric_time__day) = subq_1.metric_time__day - WHERE DATE_TRUNC('month', subq_2.metric_time__day) = subq_2.metric_time__day + WHERE subq_2.metric_time__month = subq_2.metric_time__day ) subq_4 WHERE metric_time__day = '2020-01-01' ) subq_5 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 1a409e33f..52f737090 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 - DATE_TRUNC('month', subq_12.ds) AS metric_time__month - , subq_10.metric_time__day AS metric_time__day + subq_12.ds AS metric_time__day + , DATE_TRUNC('month', subq_12.ds) AS metric_time__month , 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 0c783016e..5f00bf053 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 @@ -34,10 +34,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -111,6 +108,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -136,6 +136,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 d5393a5ab..876c920d3 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 3209ff95a..ce362e8bc 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,7 +32,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -99,7 +100,6 @@ 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 @@ -133,8 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -200,7 +199,6 @@ 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 @@ -210,6 +208,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -235,6 +235,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 854b6cf02..3934f7c7b 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 - DATE_TRUNC('month', subq_19.ds) AS metric_time__month - , DATE_TRUNC('day', bookings_source_src_28000.ds) AS metric_time__day + subq_19.ds AS metric_time__day + , DATE_TRUNC('month', subq_19.ds) AS metric_time__month , 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 c9c7b82cc..0ab46d5d7 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 @@ -42,10 +42,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -119,6 +116,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -144,6 +144,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 4197aa4fe..f5bf84db9 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 975d7267b..7a40ad53e 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 105d5d477..85ab91322 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 @@ -125,8 +125,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -202,6 +201,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 783d28a0b..2ce35c6c8 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__month AS metric_time__month - , subq_1.ds__month AS ds__month + subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year , subq_1.ds__extract_year AS ds__extract_year @@ -42,6 +41,7 @@ FROM ( , 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_2.metric_time__month AS metric_time__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 812538acb..354523834 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 05fd6da80..9e3e0140d 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__week AS metric_time__week , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATE_TRUNC('week', subq_8.ds) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( @@ -546,7 +547,7 @@ FROM ( ) subq_6 ON DATE_TRUNC('month', subq_7.metric_time__day) = subq_6.metric_time__day - WHERE DATE_TRUNC('week', subq_7.metric_time__day) = subq_7.metric_time__day + WHERE subq_7.metric_time__week = subq_7.metric_time__day ) subq_9 ) subq_10 GROUP BY 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 7461ededc..001cba041 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 75f35eb71..e87fd12b2 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__quarter AS metric_time__quarter , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATE_TRUNC('quarter', subq_8.ds) AS metric_time__quarter FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 ab2724a63..8f93159dc 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -355,8 +355,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -432,6 +431,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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 ee07090c3..749d3e18e 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,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -97,7 +96,6 @@ 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 @@ -107,6 +105,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -132,6 +132,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -331,7 +332,7 @@ FROM ( ) subq_1 ON DATE_TRUNC('month', subq_2.metric_time__day) = subq_1.metric_time__day - WHERE DATE_TRUNC('year', subq_2.metric_time__day) = subq_2.metric_time__day + WHERE subq_2.metric_time__year = subq_2.metric_time__day ) subq_4 ) subq_5 GROUP BY @@ -356,8 +357,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -423,7 +423,6 @@ 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 @@ -433,6 +432,8 @@ FROM ( , 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_10.metric_time__day AS metric_time__day + , subq_10.metric_time__year AS metric_time__year , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -458,6 +459,7 @@ FROM ( -- Time Spine SELECT subq_11.ds AS metric_time__day + , DATE_TRUNC('year', subq_11.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_11 ) subq_10 INNER JOIN ( 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 f020af8c9..553dc9603 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 @@ -449,8 +449,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day AS metric_time__day - , subq_7.ds__day AS ds__day + subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month , subq_7.ds__quarter AS ds__quarter @@ -526,6 +525,7 @@ FROM ( , 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_8.metric_time__day AS metric_time__day , 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 aa66a538c..9f2d6eca8 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 df2faa021..0ffa28457 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 992f40492..4f61151fe 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 4af2f8020..e26f8457e 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 @@ -56,8 +56,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -133,6 +132,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 ab8b4fe8b..888dde81c 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 @@ -40,8 +40,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -117,6 +116,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 352194ea8..05fa5fea7 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 @@ -41,8 +41,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -118,6 +117,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 be2498019..119d7eb57 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 @@ -45,8 +45,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -122,6 +121,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 bb8bebae2..8ade18c5b 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,7 +26,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -93,7 +94,6 @@ 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 @@ -127,8 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -194,7 +193,6 @@ 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 @@ -204,6 +202,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -229,6 +229,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -428,7 +429,7 @@ FROM ( ) subq_1 ON DATE_TRUNC('month', subq_2.metric_time__day) = subq_1.metric_time__day - WHERE DATE_TRUNC('month', subq_2.metric_time__day) = subq_2.metric_time__day + WHERE subq_2.metric_time__month = subq_2.metric_time__day ) subq_4 WHERE metric_time__day = '2020-01-01' ) subq_5 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 299a5317e..e2ef45757 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 - DATE_TRUNC('month', subq_12.ds) AS metric_time__month - , subq_10.metric_time__day AS metric_time__day + subq_12.ds AS metric_time__day + , DATE_TRUNC('month', subq_12.ds) AS metric_time__month , 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 8382aec4a..b76d09449 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 @@ -34,10 +34,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -111,6 +108,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -136,6 +136,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 1ec7288f5..ad383b3e3 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 cfab4f600..32540460b 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,7 +32,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -99,7 +100,6 @@ 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 @@ -133,8 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -200,7 +199,6 @@ 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 @@ -210,6 +208,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -235,6 +235,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 c84292cba..2608a60ba 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 - DATE_TRUNC('month', subq_19.ds) AS metric_time__month - , DATE_TRUNC('day', bookings_source_src_28000.ds) AS metric_time__day + subq_19.ds AS metric_time__day + , DATE_TRUNC('month', subq_19.ds) AS metric_time__month , 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 8855b65d2..ad98bb0ff 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 @@ -42,10 +42,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -119,6 +116,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -144,6 +144,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 b10fa0521..a2d0bb880 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 80650d8d7..45302aeb0 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 557d1e6fe..b1f5abb57 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 @@ -125,8 +125,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -202,6 +201,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 ae2f922da..f256ef01f 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__month AS metric_time__month - , subq_1.ds__month AS ds__month + subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year , subq_1.ds__extract_year AS ds__extract_year @@ -42,6 +41,7 @@ FROM ( , 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_2.metric_time__month AS metric_time__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 c16d612c3..d0c190b3f 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 ca4a37232..8d1b09a71 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__week AS metric_time__week , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATE_TRUNC('week', subq_8.ds) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( @@ -546,7 +547,7 @@ FROM ( ) subq_6 ON DATE_TRUNC('month', subq_7.metric_time__day) = subq_6.metric_time__day - WHERE DATE_TRUNC('week', subq_7.metric_time__day) = subq_7.metric_time__day + WHERE subq_7.metric_time__week = subq_7.metric_time__day ) subq_9 ) subq_10 GROUP BY 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 e6f81dcfd..b15f2f329 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 7561adfaa..8d89d86e7 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__quarter AS metric_time__quarter , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATE_TRUNC('quarter', subq_8.ds) AS metric_time__quarter FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 40e536ad6..a2a78dc51 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -355,8 +355,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -432,6 +431,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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 4d53c9768..c05df7ba0 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,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -97,7 +96,6 @@ 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 @@ -107,6 +105,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -132,6 +132,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -331,7 +332,7 @@ FROM ( ) subq_1 ON DATE_TRUNC('month', subq_2.metric_time__day) = subq_1.metric_time__day - WHERE DATE_TRUNC('year', subq_2.metric_time__day) = subq_2.metric_time__day + WHERE subq_2.metric_time__year = subq_2.metric_time__day ) subq_4 ) subq_5 GROUP BY @@ -356,8 +357,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -423,7 +423,6 @@ 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 @@ -433,6 +432,8 @@ FROM ( , 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_10.metric_time__day AS metric_time__day + , subq_10.metric_time__year AS metric_time__year , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -458,6 +459,7 @@ FROM ( -- Time Spine SELECT subq_11.ds AS metric_time__day + , DATE_TRUNC('year', subq_11.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_11 ) subq_10 INNER JOIN ( 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 c884a8a58..bffa03b60 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 @@ -449,8 +449,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day AS metric_time__day - , subq_7.ds__day AS ds__day + subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month , subq_7.ds__quarter AS ds__quarter @@ -526,6 +525,7 @@ FROM ( , 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_8.metric_time__day AS metric_time__day , 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 12bbfe786..3e5051873 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 115c00e1b..1648523c0 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 3e0efcd5a..f8554a6ac 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 495c63745..06d06dbdd 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 @@ -56,8 +56,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -133,6 +132,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 b86781bf0..637a16e5f 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 @@ -40,8 +40,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -117,6 +116,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 769d23bec..af50d71ec 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 @@ -41,8 +41,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -118,6 +117,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 c4dd0ffbe..d6513cd79 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 @@ -45,8 +45,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -122,6 +121,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 5efb6860c..f076b607a 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,7 +26,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -93,7 +94,6 @@ 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 @@ -127,8 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -194,7 +193,6 @@ 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 @@ -204,6 +202,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -229,6 +229,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -428,7 +429,7 @@ FROM ( ) subq_1 ON DATE_TRUNC('month', subq_2.metric_time__day) = subq_1.metric_time__day - WHERE DATE_TRUNC('month', subq_2.metric_time__day) = subq_2.metric_time__day + WHERE subq_2.metric_time__month = subq_2.metric_time__day ) subq_4 WHERE metric_time__day = '2020-01-01' ) subq_5 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 a018fc10a..2fec95707 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 - DATE_TRUNC('month', subq_12.ds) AS metric_time__month - , subq_10.metric_time__day AS metric_time__day + subq_12.ds AS metric_time__day + , DATE_TRUNC('month', subq_12.ds) AS metric_time__month , 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 f90e5fa8f..58c5a3746 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 @@ -34,10 +34,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -111,6 +108,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -136,6 +136,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 b75aa84f9..7a6b7cf5f 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 ac73be5b5..a47807f55 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,7 +32,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -99,7 +100,6 @@ 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 @@ -133,8 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -200,7 +199,6 @@ 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 @@ -210,6 +208,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -235,6 +235,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 f4ec730fd..28159c151 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 - DATE_TRUNC('month', subq_19.ds) AS metric_time__month - , DATE_TRUNC('day', bookings_source_src_28000.ds) AS metric_time__day + subq_19.ds AS metric_time__day + , DATE_TRUNC('month', subq_19.ds) AS metric_time__month , 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 f3b8d2d80..bb28740f7 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 @@ -42,10 +42,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -119,6 +116,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -144,6 +144,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 5c8fd1589..a15747960 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 4420c336e..b76f01c2e 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 4fc4a2416..6f292e508 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 @@ -125,8 +125,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -202,6 +201,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 120935fa1..7c13af69a 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__month AS metric_time__month - , subq_1.ds__month AS ds__month + subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year , subq_1.ds__extract_year AS ds__extract_year @@ -42,6 +41,7 @@ FROM ( , 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_2.metric_time__month AS metric_time__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 9289f7021..0189b4734 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 0cf3469d1..c54468c56 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('week', subq_7.metric_time__day) AS metric_time__week - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__week AS metric_time__week , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATE_TRUNC('week', subq_8.ds) AS metric_time__week FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( @@ -546,7 +547,7 @@ FROM ( ) subq_6 ON DATE_TRUNC('month', subq_7.metric_time__day) = subq_6.metric_time__day - WHERE DATE_TRUNC('week', subq_7.metric_time__day) = subq_7.metric_time__day + WHERE subq_7.metric_time__week = subq_7.metric_time__day ) subq_9 ) subq_10 GROUP BY 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 2d5963f8c..93c2f746c 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.metric_time__day AS metric_time__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.metric_time__day AS metric_time__day , 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 c4c52ccc6..18f995cc8 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('quarter', subq_7.metric_time__day) AS metric_time__quarter - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__quarter AS metric_time__quarter , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , DATE_TRUNC('quarter', subq_8.ds) AS metric_time__quarter FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 8f2321e8d..fcb81a11a 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -355,8 +355,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -432,6 +431,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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 cf738ae11..2d903a9bf 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,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -97,7 +96,6 @@ 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 @@ -107,6 +105,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -132,6 +132,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -331,7 +332,7 @@ FROM ( ) subq_1 ON DATE_TRUNC('month', subq_2.metric_time__day) = subq_1.metric_time__day - WHERE DATE_TRUNC('year', subq_2.metric_time__day) = subq_2.metric_time__day + WHERE subq_2.metric_time__year = subq_2.metric_time__day ) subq_4 ) subq_5 GROUP BY @@ -356,8 +357,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('year', subq_10.metric_time__day) AS metric_time__year - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -423,7 +423,6 @@ 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 @@ -433,6 +432,8 @@ FROM ( , 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_10.metric_time__day AS metric_time__day + , subq_10.metric_time__year AS metric_time__year , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -458,6 +459,7 @@ FROM ( -- Time Spine SELECT subq_11.ds AS metric_time__day + , DATE_TRUNC('year', subq_11.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_11 ) subq_10 INNER JOIN ( 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 a0eb21571..edf31671b 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 @@ -449,8 +449,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_8.metric_time__day AS metric_time__day - , subq_7.ds__day AS ds__day + subq_7.ds__day AS ds__day , subq_7.ds__week AS ds__week , subq_7.ds__month AS ds__month , subq_7.ds__quarter AS ds__quarter @@ -526,6 +525,7 @@ FROM ( , 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_8.metric_time__day AS metric_time__day , 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 32b446285..b495b75ea 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_5.metric_time__day AS metric_time__day - , subq_4.ds__day AS ds__day + subq_4.ds__day AS ds__day , subq_4.ds__week AS ds__week , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_5.metric_time__day AS metric_time__day , 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 58c9cbe4f..7cee3d0e2 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 @@ -30,8 +30,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.booking__ds__day AS booking__ds__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -107,6 +106,7 @@ FROM ( , 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_2.booking__ds__day AS booking__ds__day , 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_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 f30f6fc14..51f99d7c2 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 f29e58481..a6224db95 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 @@ -56,8 +56,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -133,6 +132,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 d2801edc7..3632170c3 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 @@ -40,8 +40,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -117,6 +116,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 4639f0b65..478c66ac3 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 @@ -41,8 +41,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -118,6 +117,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 c60220adc..5137f728c 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 @@ -45,8 +45,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -122,6 +121,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 b710e45a9..2ec0ddd63 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,7 +26,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -93,7 +94,6 @@ 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 @@ -127,8 +127,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -194,7 +193,6 @@ 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 @@ -204,6 +202,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -229,6 +229,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( @@ -428,7 +429,7 @@ FROM ( ) subq_1 ON DATE_TRUNC('month', subq_2.metric_time__day) = subq_1.metric_time__day - WHERE DATE_TRUNC('month', subq_2.metric_time__day) = subq_2.metric_time__day + WHERE subq_2.metric_time__month = subq_2.metric_time__day ) subq_4 WHERE metric_time__day = '2020-01-01' ) subq_5 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 a8f5ddb16..600f39647 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 - DATE_TRUNC('month', subq_12.ds) AS metric_time__month - , subq_10.metric_time__day AS metric_time__day + subq_12.ds AS metric_time__day + , DATE_TRUNC('month', subq_12.ds) AS metric_time__month , 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 6d9f0250a..3eaf17a95 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 @@ -34,10 +34,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -111,6 +108,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -136,6 +136,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 d949c4319..de393674d 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 fabed71c9..5e53708f1 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,7 +32,8 @@ FROM ( FROM ( -- Constrain Output with WHERE SELECT - subq_4.metric_time__month + subq_4.metric_time__day + , subq_4.metric_time__month , subq_4.ds__day , subq_4.ds__week , subq_4.ds__month @@ -99,7 +100,6 @@ 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 @@ -133,8 +133,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -200,7 +199,6 @@ 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 @@ -210,6 +208,8 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -235,6 +235,7 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 b65cacd2e..c2acb8801 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 - DATE_TRUNC('month', subq_19.ds) AS metric_time__month - , DATE_TRUNC('day', bookings_source_src_28000.ds) AS metric_time__day + subq_19.ds AS metric_time__day + , DATE_TRUNC('month', subq_19.ds) AS metric_time__month , 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 77678f8b6..515d9f35e 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 @@ -42,10 +42,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , DATE_TRUNC('month', subq_2.metric_time__day) AS metric_time__month - , DATE_TRUNC('year', subq_2.metric_time__day) AS metric_time__year - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -119,6 +116,9 @@ FROM ( , 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_2.metric_time__day AS metric_time__day + , subq_2.metric_time__month AS metric_time__month + , subq_2.metric_time__year AS metric_time__year , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -144,6 +144,8 @@ FROM ( -- Time Spine SELECT subq_3.ds AS metric_time__day + , DATE_TRUNC('month', subq_3.ds) AS metric_time__month + , DATE_TRUNC('year', subq_3.ds) AS metric_time__year FROM ***************************.mf_time_spine subq_3 ) subq_2 INNER JOIN ( 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 ec42f54a7..15cb51f81 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 @@ -245,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_7.booking__ds__day AS booking__ds__day - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -322,6 +321,7 @@ FROM ( , 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_7.booking__ds__day AS booking__ds__day , 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_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 cbbf2eae8..9ed8d165e 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__day AS metric_time__day - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -101,6 +100,7 @@ FROM ( , 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_2.metric_time__day AS metric_time__day , 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 846bb51c7..4a7eaf93c 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 @@ -259,8 +259,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -336,6 +335,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql index 6d72922e2..fccf4ae10 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql @@ -19,8 +19,8 @@ FROM ( -- Time Spine SELECT subq_6.ds AS booking__ds__day - , DATETIME_TRUNC(subq_6.ds, month) AS booking__ds__month , subq_6.ds AS metric_time__day + , DATETIME_TRUNC(subq_6.ds, month) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql index 6e6107644..9af1b967c 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql @@ -15,8 +15,8 @@ FROM ( -- Time Spine SELECT ds AS booking__ds__day - , DATETIME_TRUNC(ds, month) AS booking__ds__month , ds AS metric_time__day + , DATETIME_TRUNC(ds, month) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql index 1a8ded709..67b28a65d 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATETIME_TRUNC(subq_6.ds, month) AS booking__ds__month - , subq_6.ds AS metric_time__day + subq_6.ds AS metric_time__day + , DATETIME_TRUNC(subq_6.ds, month) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql index da1bdd42a..e6d2eaa19 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATETIME_TRUNC(ds, month) AS booking__ds__month - , ds AS metric_time__day + ds AS metric_time__day + , DATETIME_TRUNC(ds, month) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql index fd8e519d9..96c0532c9 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - subq_6.ts AS metric_time__hour - , DATETIME_TRUNC(subq_6.ts, day) AS metric_time__day + DATETIME_TRUNC(subq_6.ts, day) AS metric_time__day + , subq_6.ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql index 8f69843cf..1891b4ce1 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - ts AS metric_time__hour - , DATETIME_TRUNC(ts, day) AS metric_time__day + DATETIME_TRUNC(ts, day) AS metric_time__day + , ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_15 ) subq_16 WHERE ( 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 0b3d2f158..8c91d8e67 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 @@ -259,8 +259,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -336,6 +335,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql index 1c0867306..c8ebb2e65 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql @@ -19,8 +19,8 @@ FROM ( -- Time Spine SELECT subq_6.ds AS booking__ds__day - , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month , subq_6.ds AS metric_time__day + , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql index b0965aa8f..e3baf223a 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql @@ -15,8 +15,8 @@ FROM ( -- Time Spine SELECT ds AS booking__ds__day - , DATE_TRUNC('month', ds) AS booking__ds__month , ds AS metric_time__day + , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql index 363eabf78..a64e660e7 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATE_TRUNC('month', subq_6.ds) AS booking__ds__month - , subq_6.ds AS metric_time__day + subq_6.ds AS metric_time__day + , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql index 709f8964f..ee307f4e6 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATE_TRUNC('month', ds) AS booking__ds__month - , ds AS metric_time__day + ds AS metric_time__day + , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql index f4d1e06c4..129910dc3 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - subq_6.ts AS metric_time__hour - , DATE_TRUNC('day', subq_6.ts) AS metric_time__day + DATE_TRUNC('day', subq_6.ts) AS metric_time__day + , subq_6.ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql index a45cc35bf..e3188eb6f 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Databricks/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - ts AS metric_time__hour - , DATE_TRUNC('day', ts) AS metric_time__day + DATE_TRUNC('day', ts) AS metric_time__day + , ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_15 ) subq_16 WHERE ( 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 72cb06db0..e989f7af3 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 @@ -259,8 +259,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -336,6 +335,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql index 5dc0c4871..4c1757d74 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql @@ -19,8 +19,8 @@ FROM ( -- Time Spine SELECT subq_6.ds AS booking__ds__day - , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month , subq_6.ds AS metric_time__day + , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql index 5ee3282bc..9896fc0a0 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql @@ -15,8 +15,8 @@ FROM ( -- Time Spine SELECT ds AS booking__ds__day - , DATE_TRUNC('month', ds) AS booking__ds__month , ds AS metric_time__day + , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql index dc045898e..f7ac35e3d 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATE_TRUNC('month', subq_6.ds) AS booking__ds__month - , subq_6.ds AS metric_time__day + subq_6.ds AS metric_time__day + , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql index 883595185..2a4a9daeb 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATE_TRUNC('month', ds) AS booking__ds__month - , ds AS metric_time__day + ds AS metric_time__day + , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql index b666878d8..aaaa61a1f 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - subq_6.ts AS metric_time__hour - , DATE_TRUNC('day', subq_6.ts) AS metric_time__day + DATE_TRUNC('day', subq_6.ts) AS metric_time__day + , subq_6.ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql index 5ab18850f..a39e5f96e 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Postgres/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - ts AS metric_time__hour - , DATE_TRUNC('day', ts) AS metric_time__day + DATE_TRUNC('day', ts) AS metric_time__day + , ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_15 ) subq_16 WHERE ( 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 fce0b68b1..812c7b8a2 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 @@ -259,8 +259,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -336,6 +335,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql index 2a0c2ceea..67b528e65 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql @@ -19,8 +19,8 @@ FROM ( -- Time Spine SELECT subq_6.ds AS booking__ds__day - , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month , subq_6.ds AS metric_time__day + , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql index f0a4d3c29..2223c610d 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql @@ -15,8 +15,8 @@ FROM ( -- Time Spine SELECT ds AS booking__ds__day - , DATE_TRUNC('month', ds) AS booking__ds__month , ds AS metric_time__day + , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql index e04e39ded..202bb960e 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATE_TRUNC('month', subq_6.ds) AS booking__ds__month - , subq_6.ds AS metric_time__day + subq_6.ds AS metric_time__day + , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql index fe3be6213..2bd61a928 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATE_TRUNC('month', ds) AS booking__ds__month - , ds AS metric_time__day + ds AS metric_time__day + , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql index 1e3180ba3..057d60158 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - subq_6.ts AS metric_time__hour - , DATE_TRUNC('day', subq_6.ts) AS metric_time__day + DATE_TRUNC('day', subq_6.ts) AS metric_time__day + , subq_6.ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql index df0c8e2cd..fddc39edb 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Redshift/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - ts AS metric_time__hour - , DATE_TRUNC('day', ts) AS metric_time__day + DATE_TRUNC('day', ts) AS metric_time__day + , ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_15 ) subq_16 WHERE ( 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 9ce54cd8e..75addc998 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 @@ -259,8 +259,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -336,6 +335,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql index 3dd7c86d3..b8fb8b418 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql @@ -19,8 +19,8 @@ FROM ( -- Time Spine SELECT subq_6.ds AS booking__ds__day - , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month , subq_6.ds AS metric_time__day + , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql index f592c4814..077500fe3 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql @@ -15,8 +15,8 @@ FROM ( -- Time Spine SELECT ds AS booking__ds__day - , DATE_TRUNC('month', ds) AS booking__ds__month , ds AS metric_time__day + , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql index 90a6ffb4d..5d12ce07f 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATE_TRUNC('month', subq_6.ds) AS booking__ds__month - , subq_6.ds AS metric_time__day + subq_6.ds AS metric_time__day + , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql index f79462027..73f5bc279 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATE_TRUNC('month', ds) AS booking__ds__month - , ds AS metric_time__day + ds AS metric_time__day + , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql index 55ca26300..364d1694c 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - subq_6.ts AS metric_time__hour - , DATE_TRUNC('day', subq_6.ts) AS metric_time__day + DATE_TRUNC('day', subq_6.ts) AS metric_time__day + , subq_6.ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql index 6f898cc9f..166b517fe 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - ts AS metric_time__hour - , DATE_TRUNC('day', ts) AS metric_time__day + DATE_TRUNC('day', ts) AS metric_time__day + , ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_15 ) subq_16 WHERE ( 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 490a80a6f..ad1a8e305 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 @@ -259,8 +259,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_10.metric_time__day AS metric_time__day - , subq_9.ds__day AS ds__day + subq_9.ds__day AS ds__day , subq_9.ds__week AS ds__week , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter @@ -336,6 +335,7 @@ FROM ( , 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_10.metric_time__day AS metric_time__day , 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_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql index 6239e8a6f..9bae1142d 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql @@ -19,8 +19,8 @@ FROM ( -- Time Spine SELECT subq_6.ds AS booking__ds__day - , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month , subq_6.ds AS metric_time__day + , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql index 692c69005..2fc1c3856 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql @@ -15,8 +15,8 @@ FROM ( -- Time Spine SELECT ds AS booking__ds__day - , DATE_TRUNC('month', ds) AS booking__ds__month , ds AS metric_time__day + , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql index cab98b4d7..cabb72077 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATE_TRUNC('month', subq_6.ds) AS booking__ds__month - , subq_6.ds AS metric_time__day + subq_6.ds AS metric_time__day + , DATE_TRUNC('month', subq_6.ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql index 301f1b0a7..92b7232c9 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - DATE_TRUNC('month', ds) AS booking__ds__month - , ds AS metric_time__day + ds AS metric_time__day + , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine subq_15 ) subq_16 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql index e19a79f12..eab971602 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql @@ -18,8 +18,8 @@ FROM ( FROM ( -- Time Spine SELECT - subq_6.ts AS metric_time__hour - , DATE_TRUNC('day', subq_6.ts) AS metric_time__day + DATE_TRUNC('day', subq_6.ts) AS metric_time__day + , subq_6.ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_6 ) subq_7 WHERE ( diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql index a37557117..9463184ff 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/Trino/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql @@ -14,8 +14,8 @@ FROM ( FROM ( -- Time Spine SELECT - ts AS metric_time__hour - , DATE_TRUNC('day', ts) AS metric_time__day + DATE_TRUNC('day', ts) AS metric_time__day + , ts AS metric_time__hour FROM ***************************.mf_time_spine_hour subq_15 ) subq_16 WHERE ( 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 ab2139687..111ee631b 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - 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__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , IF(EXTRACT(dayofweek FROM subq_8.ds) = 1, 7, EXTRACT(dayofweek FROM subq_8.ds) - 1) AS metric_time__extract_dow FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 f6cbd6340..6c7e38678 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 91f6460c8..33aca9778 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 586021ce5..0ec491101 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - EXTRACT(DAYOFWEEK_ISO FROM subq_7.metric_time__day) AS metric_time__extract_dow - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , EXTRACT(DAYOFWEEK_ISO FROM subq_8.ds) AS metric_time__extract_dow FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 bf9e66ea8..59962152a 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 097b13f08..2890a7a26 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 863920537..22a272a10 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - EXTRACT(isodow FROM subq_7.metric_time__day) AS metric_time__extract_dow - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , EXTRACT(isodow FROM subq_8.ds) AS metric_time__extract_dow FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 4a4aa1d5d..6317545a9 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 15163da5a..f64704a88 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 084b29ac9..1096c230d 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - 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__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , CASE WHEN EXTRACT(dow FROM subq_8.ds) = 0 THEN EXTRACT(dow FROM subq_8.ds) + 7 ELSE EXTRACT(dow FROM subq_8.ds) END AS metric_time__extract_dow FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 60c1045d2..d19f1c897 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 53c91fdce..f410899b7 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 a5bfbf746..370d05b99 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - EXTRACT(dayofweekiso FROM subq_7.metric_time__day) AS metric_time__extract_dow - , subq_6.ds__day AS ds__day + subq_6.ds__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , EXTRACT(dayofweekiso FROM subq_8.ds) AS metric_time__extract_dow FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 e4e795f63..d14e62beb 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 23890bb35..af585fd02 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 6a982eb19..45b7443a1 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,8 +245,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - 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__day AS ds__day , subq_6.ds__week AS ds__week , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter @@ -312,7 +311,6 @@ 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 @@ -322,6 +320,8 @@ FROM ( , 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_7.metric_time__day AS metric_time__day + , subq_7.metric_time__extract_dow AS metric_time__extract_dow , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -347,6 +347,7 @@ FROM ( -- Time Spine SELECT subq_8.ds AS metric_time__day + , EXTRACT(DAY_OF_WEEK FROM subq_8.ds) AS metric_time__extract_dow FROM ***************************.mf_time_spine subq_8 ) subq_7 INNER JOIN ( 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 74b767a3c..9e99453ce 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 384799b70..55c721893 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 @@ -24,8 +24,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_2.metric_time__hour AS metric_time__hour - , subq_1.ds__day AS ds__day + subq_1.ds__day AS ds__day , subq_1.ds__week AS ds__week , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter @@ -210,6 +209,7 @@ FROM ( , 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_2.metric_time__hour AS metric_time__hour , 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 393782f27..d1b2aaae3 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 @@ -836,8 +836,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_15.metric_time__day AS metric_time__day - , subq_14.ds__day AS ds__day + subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month , subq_14.ds__quarter AS ds__quarter @@ -913,6 +912,7 @@ FROM ( , 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_15.metric_time__day AS metric_time__day , 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 d9a3c7f8e..3bb997bf3 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 @@ -809,8 +809,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.metric_time__day AS metric_time__day - , subq_11.ds__day AS ds__day + subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month , subq_11.ds__quarter AS ds__quarter @@ -886,6 +885,7 @@ FROM ( , 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_12.metric_time__day AS metric_time__day , 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 8ca173f41..c7959ef34 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 @@ -836,8 +836,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_15.metric_time__day AS metric_time__day - , subq_14.ds__day AS ds__day + subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month , subq_14.ds__quarter AS ds__quarter @@ -913,6 +912,7 @@ FROM ( , 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_15.metric_time__day AS metric_time__day , 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 b41872c4c..963e745d2 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 @@ -809,8 +809,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.metric_time__day AS metric_time__day - , subq_11.ds__day AS ds__day + subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month , subq_11.ds__quarter AS ds__quarter @@ -886,6 +885,7 @@ FROM ( , 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_12.metric_time__day AS metric_time__day , 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 73b0e1ff7..97934bdce 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 @@ -836,8 +836,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_15.metric_time__day AS metric_time__day - , subq_14.ds__day AS ds__day + subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month , subq_14.ds__quarter AS ds__quarter @@ -913,6 +912,7 @@ FROM ( , 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_15.metric_time__day AS metric_time__day , 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 5e5ff825b..adb7666e0 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 @@ -809,8 +809,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.metric_time__day AS metric_time__day - , subq_11.ds__day AS ds__day + subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month , subq_11.ds__quarter AS ds__quarter @@ -886,6 +885,7 @@ FROM ( , 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_12.metric_time__day AS metric_time__day , 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 891ef6bdc..0afe6a1f5 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 @@ -836,8 +836,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_15.metric_time__day AS metric_time__day - , subq_14.ds__day AS ds__day + subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month , subq_14.ds__quarter AS ds__quarter @@ -913,6 +912,7 @@ FROM ( , 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_15.metric_time__day AS metric_time__day , 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 89dfe569d..0bd18ea92 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 @@ -809,8 +809,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.metric_time__day AS metric_time__day - , subq_11.ds__day AS ds__day + subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month , subq_11.ds__quarter AS ds__quarter @@ -886,6 +885,7 @@ FROM ( , 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_12.metric_time__day AS metric_time__day , 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 a8c53b115..fb5907604 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 @@ -836,8 +836,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_15.metric_time__day AS metric_time__day - , subq_14.ds__day AS ds__day + subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month , subq_14.ds__quarter AS ds__quarter @@ -913,6 +912,7 @@ FROM ( , 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_15.metric_time__day AS metric_time__day , 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 7083f023f..1943ab087 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 @@ -809,8 +809,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.metric_time__day AS metric_time__day - , subq_11.ds__day AS ds__day + subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month , subq_11.ds__quarter AS ds__quarter @@ -886,6 +885,7 @@ FROM ( , 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_12.metric_time__day AS metric_time__day , 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 e4f3d7c56..fe131b3a1 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 @@ -836,8 +836,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_15.metric_time__day AS metric_time__day - , subq_14.ds__day AS ds__day + subq_14.ds__day AS ds__day , subq_14.ds__week AS ds__week , subq_14.ds__month AS ds__month , subq_14.ds__quarter AS ds__quarter @@ -913,6 +912,7 @@ FROM ( , 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_15.metric_time__day AS metric_time__day , 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 229c9671e..ba9beece0 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 @@ -809,8 +809,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - subq_12.metric_time__day AS metric_time__day - , subq_11.ds__day AS ds__day + subq_11.ds__day AS ds__day , subq_11.ds__week AS ds__week , subq_11.ds__month AS ds__month , subq_11.ds__quarter AS ds__quarter @@ -886,6 +885,7 @@ FROM ( , 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_12.metric_time__day AS metric_time__day , subq_11.listing AS listing , subq_11.guest AS guest , subq_11.host AS host