diff --git a/metricflow/dataset/convert_semantic_model.py b/metricflow/dataset/convert_semantic_model.py index b93208d21..56ee4279e 100644 --- a/metricflow/dataset/convert_semantic_model.py +++ b/metricflow/dataset/convert_semantic_model.py @@ -528,13 +528,11 @@ def build_time_spine_source_data_set(self, time_spine_source: TimeSpineSource) - time_granularity=ExpandedTimeGranularity.from_time_granularity(base_granularity), ) time_dimension_instances.append(base_time_dimension_instance) - base_dimension_select_expr = SemanticModelToDataSetConverter._make_element_sql_expr( - table_alias=from_source_alias, element_name=base_column_name + base_dimension_select_expr = SqlColumnReferenceExpression.from_table_and_column_names( + table_alias=from_source_alias, column_name=base_column_name ) - base_select_column = self._build_column_for_standard_time_granularity( - time_granularity=base_granularity, - expr=base_dimension_select_expr, - column_alias=base_time_dimension_instance.associated_column.column_name, + base_select_column = SqlSelectColumn( + expr=base_dimension_select_expr, column_alias=base_time_dimension_instance.associated_column.column_name ) select_columns.append(base_select_column) new_base_instances, new_base_columns = self._build_time_dimension_instances_and_columns( diff --git a/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/DuckDB/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0.sql b/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/DuckDB/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0.sql index d6c0d85ba..2c374bed8 100644 --- a/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/DuckDB/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0.sql +++ b/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/DuckDB/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0.sql @@ -31,7 +31,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter @@ -161,7 +161,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/DuckDB/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0_optimized.sql b/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/DuckDB/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0_optimized.sql index 38778a99e..1bab2d34d 100644 --- a/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/DuckDB/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/DuckDB/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0_optimized.sql @@ -27,7 +27,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_26.visits AS visits FROM ***************************.mf_time_spine time_spine_src_28006 LEFT OUTER JOIN ( @@ -42,12 +42,12 @@ FROM ( metric_time__day ) subq_26 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_26.metric_time__day + time_spine_src_28006.ds = subq_26.metric_time__day ) subq_30 FULL OUTER JOIN ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_39.buys AS buys FROM ***************************.mf_time_spine time_spine_src_28006 LEFT OUTER JOIN ( @@ -113,7 +113,7 @@ FROM ( metric_time__day ) subq_39 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_39.metric_time__day + time_spine_src_28006.ds = subq_39.metric_time__day ) subq_43 ON subq_30.metric_time__day = subq_43.metric_time__day diff --git a/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0.xml b/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0.xml index 889679854..fa3418d78 100644 --- a/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0.xml +++ b/tests_metricflow/snapshots/test_conversion_metrics_to_sql.py/SqlQueryPlan/test_conversion_metric_join_to_timespine_and_fill_nulls_with_0__plan0.xml @@ -92,22 +92,25 @@ docstring: - - + + + + + - + - + - + - + @@ -602,22 +605,25 @@ docstring: - - + + + + + - + - + - + - + diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_window_metric_with_non_default_grains__plan0.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_window_metric_with_non_default_grains__plan0.sql index 3620f1e97..8ee78b084 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_window_metric_with_non_default_grains__plan0.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_window_metric_with_non_default_grains__plan0.sql @@ -55,7 +55,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_window_metric_with_non_default_grains__plan0_optimized.sql b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_window_metric_with_non_default_grains__plan0_optimized.sql index 0f2cf5d21..e22a6a683 100644 --- a/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_window_metric_with_non_default_grains__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_cumulative_metric_rendering.py/SqlQueryPlan/DuckDB/test_window_metric_with_non_default_grains__plan0_optimized.sql @@ -29,7 +29,7 @@ FROM ( SELECT DATE_TRUNC('month', time_spine_src_28006.ds) AS booking__ds__month , DATE_TRUNC('week', time_spine_src_28006.ds) AS metric_time__week - , DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + , time_spine_src_28006.ds AS metric_time__day , subq_19.bookers AS bookers FROM ***************************.mf_time_spine time_spine_src_28006 LEFT OUTER JOIN ( @@ -56,7 +56,7 @@ FROM ( , DATE_TRUNC('week', subq_16.ds) ) subq_19 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_19.metric_time__day + time_spine_src_28006.ds = subq_19.metric_time__day ) subq_23 ) subq_25 GROUP BY diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_metric_grouped_by_custom_grain__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_metric_grouped_by_custom_grain__plan0.sql index 55e53933e..bb34ed558 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_metric_grouped_by_custom_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_metric_grouped_by_custom_grain__plan0.sql @@ -27,7 +27,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_metric_grouped_by_custom_grain__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_metric_grouped_by_custom_grain__plan0_optimized.sql index 5e4069763..a3263b692 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_metric_grouped_by_custom_grain__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_metric_grouped_by_custom_grain__plan0_optimized.sql @@ -17,7 +17,7 @@ FROM ( LEFT OUTER JOIN ***************************.mf_time_spine subq_16 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_16.ds + time_spine_src_28006.ds = subq_16.ds GROUP BY subq_16.martian_day ) subq_18 diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0.sql index 8674cf281..1caf91d65 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0.sql @@ -413,7 +413,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql index 022d8736c..6d72678d0 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql @@ -10,14 +10,14 @@ SELECT subq_12.martian_day AS user__bio_added_ts__martian_day , subq_11.martian_day AS metric_time__martian_day , DATE_TRUNC('month', users_ds_source_src_28000.bio_added_ts) AS user__bio_added_ts__month - , DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + , time_spine_src_28006.ds AS metric_time__day FROM ***************************.dim_users users_ds_source_src_28000 CROSS JOIN ***************************.mf_time_spine time_spine_src_28006 LEFT OUTER JOIN ***************************.mf_time_spine subq_11 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_11.ds + time_spine_src_28006.ds = subq_11.ds LEFT OUTER JOIN ***************************.mf_time_spine subq_12 ON @@ -26,4 +26,4 @@ GROUP BY subq_12.martian_day , subq_11.martian_day , DATE_TRUNC('month', users_ds_source_src_28000.bio_added_ts) - , DATE_TRUNC('day', time_spine_src_28006.ds) + , time_spine_src_28006.ds diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0.sql index fbb0fa092..ce794260a 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0.sql @@ -37,7 +37,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0_optimized.sql index 3d4ff1f12..8bc925e0f 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0_optimized.sql @@ -11,6 +11,6 @@ FROM ***************************.mf_time_spine time_spine_src_28006 LEFT OUTER JOIN ***************************.mf_time_spine subq_4 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_4.ds + time_spine_src_28006.ds = subq_4.ds GROUP BY subq_4.martian_day diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity__plan0.sql index 1e88bd6e0..3f621b90e 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity__plan0.sql @@ -136,7 +136,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity__plan0_optimized.sql index 817082e44..7de34b0ee 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity__plan0_optimized.sql @@ -25,11 +25,11 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_11 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 5 day = subq_11.booking__ds__day + time_spine_src_28006.ds - INTERVAL 5 day = subq_11.booking__ds__day LEFT OUTER JOIN ***************************.mf_time_spine subq_15 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_15.ds + time_spine_src_28006.ds = subq_15.ds GROUP BY subq_15.martian_day ) subq_19 diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql index 27c20a697..0868ab652 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0.sql @@ -238,7 +238,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0_optimized.sql index b811aecf0..139cbfa16 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_offset_metric_with_custom_granularity_filter_not_in_group_by__plan0_optimized.sql @@ -18,7 +18,7 @@ FROM ( -- Join to Time Spine Dataset -- Join to Custom Granularity Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_12.bookings AS bookings , subq_16.martian_day AS metric_time__martian_day FROM ***************************.mf_time_spine time_spine_src_28006 @@ -31,11 +31,11 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_12 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 5 day = subq_12.metric_time__day + time_spine_src_28006.ds - INTERVAL 5 day = subq_12.metric_time__day LEFT OUTER JOIN ***************************.mf_time_spine subq_16 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_16.ds + time_spine_src_28006.ds = subq_16.ds ) subq_17 WHERE metric_time__martian_day = '2020-01-01' GROUP BY diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql index 60fbb56c3..b1a5dc422 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_time_offset_metric_with_time_constraint__plan0.sql @@ -235,7 +235,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_time_offset_metric_with_time_constraint__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_time_offset_metric_with_time_constraint__plan0_optimized.sql index c32774600..90bd2622f 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_time_offset_metric_with_time_constraint__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_time_offset_metric_with_time_constraint__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , COUNT(DISTINCT subq_17.bookers) AS every_2_days_bookers_2_days_ago FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -32,8 +32,8 @@ FROM ( ) ) subq_17 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 2 day = subq_17.metric_time__day - WHERE DATE_TRUNC('day', time_spine_src_28006.ds) BETWEEN '2019-12-19' AND '2020-01-02' + time_spine_src_28006.ds - INTERVAL 2 day = subq_17.metric_time__day + WHERE time_spine_src_28006.ds BETWEEN '2019-12-19' AND '2020-01-02' GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_25 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql index 48ee8dbe0..ba396053f 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_month_dimension_and_offset_window__plan0.sql @@ -57,7 +57,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_16006.ds) AS ds__day + time_spine_src_16006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_16006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_16006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_16006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql index c12c3da26..6c821139f 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql @@ -355,7 +355,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0_optimized.sql index dc912062d..e72d76df2 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0_optimized.sql @@ -36,7 +36,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , SUM(subq_21.bookings) AS bookings_at_start_of_month FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -48,9 +48,9 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_21 ON - DATE_TRUNC('month', DATE_TRUNC('day', time_spine_src_28006.ds)) = subq_21.metric_time__day + DATE_TRUNC('month', time_spine_src_28006.ds) = subq_21.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_28 ON subq_19.metric_time__day = subq_28.metric_time__day diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 1b9b87061..88aa26d88 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -358,7 +358,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0_optimized.sql index e34f57bac..d26cf723d 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0_optimized.sql @@ -48,8 +48,8 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_21 ON - DATE_TRUNC('month', DATE_TRUNC('day', time_spine_src_28006.ds)) = subq_21.metric_time__day - WHERE DATE_TRUNC('week', time_spine_src_28006.ds) = DATE_TRUNC('day', time_spine_src_28006.ds) + DATE_TRUNC('month', time_spine_src_28006.ds) = subq_21.metric_time__day + WHERE DATE_TRUNC('week', time_spine_src_28006.ds) = time_spine_src_28006.ds GROUP BY DATE_TRUNC('week', time_spine_src_28006.ds) ) subq_28 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql index 7d18b0010..6845f9bc0 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql @@ -355,7 +355,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0_optimized.sql index 68f4871ba..705f82e6b 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0_optimized.sql @@ -36,7 +36,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , SUM(subq_21.bookings) AS bookings_2_weeks_ago FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -48,9 +48,9 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_21 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 14 day = subq_21.metric_time__day + time_spine_src_28006.ds - INTERVAL 14 day = subq_21.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_28 ON subq_19.metric_time__day = subq_28.metric_time__day diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 257b9ac92..c796f5d52 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -358,7 +358,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0_optimized.sql index 6724277d3..29d1a6106 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0_optimized.sql @@ -48,7 +48,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_21 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 14 day = subq_21.metric_time__day + time_spine_src_28006.ds - INTERVAL 14 day = subq_21.metric_time__day GROUP BY DATE_TRUNC('quarter', time_spine_src_28006.ds) ) subq_28 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 30c593060..04acc1d8f 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -140,7 +140,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter @@ -487,7 +487,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0_optimized.sql index b1216a35d..3be3f783e 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0_optimized.sql @@ -18,7 +18,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , SUM(subq_20.bookings) AS month_start_bookings FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -30,9 +30,9 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_20 ON - DATE_TRUNC('month', DATE_TRUNC('day', time_spine_src_28006.ds)) = subq_20.metric_time__day + DATE_TRUNC('month', time_spine_src_28006.ds) = subq_20.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_27 FULL OUTER JOIN ( -- Join to Time Spine Dataset @@ -40,7 +40,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , SUM(subq_29.bookings) AS bookings_1_month_ago FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -52,9 +52,9 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_29 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 1 month = subq_29.metric_time__day + time_spine_src_28006.ds - INTERVAL 1 month = subq_29.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_36 ON subq_27.metric_time__day = subq_36.metric_time__day diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 01818f2b9..4ac598fbe 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -143,7 +143,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter @@ -494,7 +494,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0_optimized.sql index a7455ee80..d46a8c2a7 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0_optimized.sql @@ -30,8 +30,8 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_20 ON - DATE_TRUNC('month', DATE_TRUNC('day', time_spine_src_28006.ds)) = subq_20.metric_time__day - WHERE DATE_TRUNC('year', time_spine_src_28006.ds) = DATE_TRUNC('day', time_spine_src_28006.ds) + DATE_TRUNC('month', time_spine_src_28006.ds) = subq_20.metric_time__day + WHERE DATE_TRUNC('year', time_spine_src_28006.ds) = time_spine_src_28006.ds GROUP BY DATE_TRUNC('year', time_spine_src_28006.ds) ) subq_27 @@ -53,7 +53,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_29 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 1 month = subq_29.metric_time__day + time_spine_src_28006.ds - INTERVAL 1 month = subq_29.metric_time__day GROUP BY DATE_TRUNC('year', time_spine_src_28006.ds) ) subq_36 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_time_filter__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_time_filter__plan0.sql index b30984419..f5b3979e4 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_time_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_time_filter__plan0.sql @@ -559,7 +559,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_time_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_time_filter__plan0_optimized.sql index 3228f97b2..f32446618 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_time_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_time_filter__plan0_optimized.sql @@ -43,7 +43,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_24.bookings AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -55,7 +55,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_24 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 14 day = subq_24.metric_time__day + time_spine_src_28006.ds - INTERVAL 14 day = subq_24.metric_time__day ) subq_28 WHERE metric_time__day = '2020-01-01' or metric_time__day = '2020-01-14' GROUP BY diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql index 26d198439..d7fe86960 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql @@ -134,7 +134,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0_optimized.sql index 09aae77d1..adf2d6a79 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0_optimized.sql @@ -12,7 +12,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , COUNT(DISTINCT subq_16.bookers) AS every_2_days_bookers_2_days_ago FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -31,7 +31,7 @@ FROM ( ) ) subq_16 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 2 day = subq_16.metric_time__day + time_spine_src_28006.ds - INTERVAL 2 day = subq_16.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_23 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_agg_time_dim__plan0.sql index e276f3034..579e062b6 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_agg_time_dim__plan0.sql @@ -140,7 +140,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_agg_time_dim__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_agg_time_dim__plan0_optimized.sql index 17ac2ea6a..8a8f9c46d 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_agg_time_dim__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_agg_time_dim__plan0_optimized.sql @@ -18,15 +18,15 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS booking__ds__day + time_spine_src_28006.ds AS booking__ds__day , SUM(bookings_source_src_28000.booking_value) AS booking_value FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ***************************.fct_bookings bookings_source_src_28000 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 1 week = DATE_TRUNC('day', bookings_source_src_28000.ds) + time_spine_src_28006.ds - INTERVAL 1 week = DATE_TRUNC('day', bookings_source_src_28000.ds) GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_23 FULL OUTER JOIN ( -- Read Elements From Semantic Model 'bookings_source' diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql index 0e046bbbe..bcca782ca 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -134,7 +134,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0_optimized.sql index 039c786eb..9de842c71 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0_optimized.sql @@ -12,7 +12,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , SUM(subq_10.bookings) AS bookings_5_days_ago FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -24,7 +24,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_10 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 5 day = subq_10.metric_time__day + time_spine_src_28006.ds - INTERVAL 5 day = subq_10.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_17 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql index fa4feee8f..2dc8c3744 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0.sql @@ -35,7 +35,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter @@ -188,7 +188,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0_optimized.sql index f35f435ae..42b724326 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_offset_with_joined_where_constraint_not_selected__plan0_optimized.sql @@ -15,7 +15,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_25.booking__is_instant AS booking__is_instant , subq_25.bookings_offset_once AS bookings_offset_once FROM ***************************.mf_time_spine time_spine_src_28006 @@ -31,7 +31,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_17.booking__is_instant AS booking__is_instant , SUM(subq_17.bookings) AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 @@ -45,14 +45,14 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_17 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 5 day = subq_17.metric_time__day + time_spine_src_28006.ds - INTERVAL 5 day = subq_17.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds , subq_17.booking__is_instant ) subq_24 ) subq_25 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 2 day = subq_25.metric_time__day + time_spine_src_28006.ds - INTERVAL 2 day = subq_25.metric_time__day ) subq_29 WHERE booking__is_instant ) subq_31 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_with_offset_multiple_input_metrics__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_with_offset_multiple_input_metrics__plan0.sql index 26868d885..6574468fc 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_with_offset_multiple_input_metrics__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_with_offset_multiple_input_metrics__plan0.sql @@ -29,7 +29,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_with_offset_multiple_input_metrics__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_with_offset_multiple_input_metrics__plan0_optimized.sql index 72c961aee..37b1d7d77 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_with_offset_multiple_input_metrics__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_derived_metric_with_offset_multiple_input_metrics__plan0_optimized.sql @@ -15,7 +15,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_22.booking_fees_start_of_month AS booking_fees_start_of_month FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -38,7 +38,7 @@ FROM ( ) subq_21 ) subq_22 ON - DATE_TRUNC('month', DATE_TRUNC('day', time_spine_src_28006.ds)) = subq_22.metric_time__day + DATE_TRUNC('month', time_spine_src_28006.ds) = subq_22.metric_time__day ) subq_26 FULL OUTER JOIN ( -- Compute Metrics via Expressions diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets__plan0.sql index 90ee7dc5b..9d009a63e 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets__plan0.sql @@ -23,7 +23,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter @@ -172,7 +172,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets__plan0_optimized.sql index 7b5122abe..fe15c86bd 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets__plan0_optimized.sql @@ -9,7 +9,7 @@ SELECT FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_23.bookings_offset_once AS bookings_offset_once FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -23,7 +23,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , SUM(subq_15.bookings) AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -35,11 +35,11 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_15 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 5 day = subq_15.metric_time__day + time_spine_src_28006.ds - INTERVAL 5 day = subq_15.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_22 ) subq_23 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 2 day = subq_23.metric_time__day + time_spine_src_28006.ds - INTERVAL 2 day = subq_23.metric_time__day ) subq_27 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_time_constraint__plan0.sql index 31148bb43..bdad0167e 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_time_constraint__plan0.sql @@ -28,7 +28,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter @@ -177,7 +177,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_time_constraint__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_time_constraint__plan0_optimized.sql index e968ba5c3..6a16e0902 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_time_constraint__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_time_constraint__plan0_optimized.sql @@ -10,7 +10,7 @@ FROM ( -- Join to Time Spine Dataset -- Constrain Time Range to [2020-01-12T00:00:00, 2020-01-13T00:00:00] SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_24.bookings_offset_once AS bookings_offset_once FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -24,7 +24,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , SUM(subq_16.bookings) AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -36,12 +36,12 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_16 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 5 day = subq_16.metric_time__day + time_spine_src_28006.ds - INTERVAL 5 day = subq_16.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_23 ) subq_24 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 2 day = subq_24.metric_time__day - WHERE DATE_TRUNC('day', time_spine_src_28006.ds) BETWEEN '2020-01-12' AND '2020-01-13' + time_spine_src_28006.ds - INTERVAL 2 day = subq_24.metric_time__day + WHERE time_spine_src_28006.ds BETWEEN '2020-01-12' AND '2020-01-13' ) subq_29 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_where_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_where_constraint__plan0.sql index b514f2012..dce7677f8 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_where_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_where_constraint__plan0.sql @@ -28,7 +28,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter @@ -177,7 +177,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_where_constraint__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_where_constraint__plan0_optimized.sql index dede1c8e9..c25d4f0b9 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_where_constraint__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_nested_offsets_with_where_constraint__plan0_optimized.sql @@ -14,7 +14,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_24.bookings_offset_once AS bookings_offset_once FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -28,7 +28,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , SUM(subq_16.bookings) AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -40,13 +40,13 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_16 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 5 day = subq_16.metric_time__day + time_spine_src_28006.ds - INTERVAL 5 day = subq_16.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_23 ) subq_24 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 2 day = subq_24.metric_time__day + time_spine_src_28006.ds - INTERVAL 2 day = subq_24.metric_time__day ) subq_28 WHERE metric_time__day = '2020-01-12' or metric_time__day = '2020-01-13' ) subq_29 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql index 9df60eefb..13d2ef129 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0.sql @@ -240,7 +240,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 755771b69..c2297b6de 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -20,7 +20,7 @@ FROM ( -- Join to Time Spine Dataset SELECT DATE_TRUNC('month', time_spine_src_28006.ds) AS metric_time__month - , DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + , time_spine_src_28006.ds AS metric_time__day , subq_11.bookings AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -32,8 +32,8 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_11 ON - DATE_TRUNC('month', DATE_TRUNC('day', time_spine_src_28006.ds)) = subq_11.metric_time__day - WHERE DATE_TRUNC('month', time_spine_src_28006.ds) = DATE_TRUNC('day', time_spine_src_28006.ds) + DATE_TRUNC('month', time_spine_src_28006.ds) = subq_11.metric_time__day + WHERE DATE_TRUNC('month', time_spine_src_28006.ds) = time_spine_src_28006.ds ) subq_15 WHERE metric_time__day = '2020-01-01' GROUP BY diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_multiple_granularities__plan0.sql index fd2b0d01a..29664c5a4 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_multiple_granularities__plan0.sql @@ -150,7 +150,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_multiple_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_multiple_granularities__plan0_optimized.sql index ae1675bc4..95d682c27 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_multiple_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_metric_multiple_granularities__plan0_optimized.sql @@ -16,7 +16,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , DATE_TRUNC('month', time_spine_src_28006.ds) AS metric_time__month , DATE_TRUNC('year', time_spine_src_28006.ds) AS metric_time__year , SUM(subq_10.bookings) AS bookings_start_of_month @@ -30,9 +30,9 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_10 ON - DATE_TRUNC('month', DATE_TRUNC('day', time_spine_src_28006.ds)) = subq_10.metric_time__day + DATE_TRUNC('month', time_spine_src_28006.ds) = subq_10.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds , DATE_TRUNC('month', time_spine_src_28006.ds) , DATE_TRUNC('year', time_spine_src_28006.ds) ) subq_17 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_with_agg_time_dim__plan0.sql index 3de46500f..7390bca8b 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_with_agg_time_dim__plan0.sql @@ -355,7 +355,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_with_agg_time_dim__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_with_agg_time_dim__plan0_optimized.sql index 75a885dac..c9d0b3138 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_with_agg_time_dim__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_to_grain_with_agg_time_dim__plan0_optimized.sql @@ -36,7 +36,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS booking__ds__day + time_spine_src_28006.ds AS booking__ds__day , SUM(subq_21.bookings) AS bookings_at_start_of_month FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -48,9 +48,9 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_21 ON - DATE_TRUNC('month', DATE_TRUNC('day', time_spine_src_28006.ds)) = subq_21.booking__ds__day + DATE_TRUNC('month', time_spine_src_28006.ds) = subq_21.booking__ds__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_28 ON subq_19.booking__ds__day = subq_28.booking__ds__day diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql index c7c4b0576..1bf29e7a0 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_filter_and_query_have_different_granularities__plan0.sql @@ -246,7 +246,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql index 9c111b5bc..8b72319e3 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_filter_and_query_have_different_granularities__plan0_optimized.sql @@ -26,13 +26,13 @@ FROM ( -- Join to Time Spine Dataset SELECT DATE_TRUNC('month', time_spine_src_28006.ds) AS metric_time__month - , DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + , time_spine_src_28006.ds AS metric_time__day , bookings_source_src_28000.booking_value AS booking_value FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ***************************.fct_bookings bookings_source_src_28000 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 1 week = DATE_TRUNC('day', bookings_source_src_28000.ds) + time_spine_src_28006.ds - INTERVAL 1 week = DATE_TRUNC('day', bookings_source_src_28000.ds) ) subq_22 WHERE metric_time__day = '2020-01-01' GROUP BY diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_multiple_granularities__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_multiple_granularities__plan0.sql index 20daf1442..0237058bf 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_multiple_granularities__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_multiple_granularities__plan0.sql @@ -158,7 +158,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_multiple_granularities__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_multiple_granularities__plan0_optimized.sql index a53bd95de..917fe0c41 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_multiple_granularities__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_metric_multiple_granularities__plan0_optimized.sql @@ -24,7 +24,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , DATE_TRUNC('month', time_spine_src_28006.ds) AS metric_time__month , DATE_TRUNC('year', time_spine_src_28006.ds) AS metric_time__year , SUM(bookings_source_src_28000.booking_value) AS booking_value @@ -32,9 +32,9 @@ FROM ( INNER JOIN ***************************.fct_bookings bookings_source_src_28000 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 1 week = DATE_TRUNC('day', bookings_source_src_28000.ds) + time_spine_src_28006.ds - INTERVAL 1 week = DATE_TRUNC('day', bookings_source_src_28000.ds) GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds , DATE_TRUNC('month', time_spine_src_28006.ds) , DATE_TRUNC('year', time_spine_src_28006.ds) ) subq_23 diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_agg_time_dim__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_agg_time_dim__plan0.sql index 9d923a5c2..8b6e243b5 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_agg_time_dim__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_agg_time_dim__plan0.sql @@ -355,7 +355,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_agg_time_dim__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_agg_time_dim__plan0_optimized.sql index fe5d694eb..cc540d2ea 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_agg_time_dim__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_agg_time_dim__plan0_optimized.sql @@ -36,7 +36,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS booking__ds__day + time_spine_src_28006.ds AS booking__ds__day , SUM(subq_21.bookings) AS bookings_2_weeks_ago FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -48,9 +48,9 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_21 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 14 day = subq_21.booking__ds__day + time_spine_src_28006.ds - INTERVAL 14 day = subq_21.booking__ds__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_28 ON subq_19.booking__ds__day = subq_28.booking__ds__day diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_time_offset_metric_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_time_offset_metric_with_time_constraint__plan0.sql index 5d70ba04f..ffc964561 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_time_offset_metric_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_time_offset_metric_with_time_constraint__plan0.sql @@ -235,7 +235,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_time_offset_metric_with_time_constraint__plan0_optimized.sql b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_time_offset_metric_with_time_constraint__plan0_optimized.sql index 0a2fcd5c9..749d48dc3 100644 --- a/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_time_offset_metric_with_time_constraint__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_derived_metric_rendering.py/SqlQueryPlan/DuckDB/test_time_offset_metric_with_time_constraint__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , SUM(subq_11.bookings) AS bookings_5_days_ago FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -25,8 +25,8 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_11 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 5 day = subq_11.metric_time__day - WHERE DATE_TRUNC('day', time_spine_src_28006.ds) BETWEEN '2019-12-19' AND '2020-01-02' + time_spine_src_28006.ds - INTERVAL 5 day = subq_11.metric_time__day + WHERE time_spine_src_28006.ds BETWEEN '2019-12-19' AND '2020-01-02' GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_19 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_fill_nulls__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_fill_nulls__plan0.sql index 511a54921..0404b1219 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_fill_nulls__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_fill_nulls__plan0.sql @@ -23,7 +23,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_fill_nulls__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_fill_nulls__plan0_optimized.sql index d02735684..15065b1c7 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_fill_nulls__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_cumulative_fill_nulls__plan0_optimized.sql @@ -9,7 +9,7 @@ SELECT FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_17.bookers AS bookers FROM ***************************.mf_time_spine time_spine_src_28006 LEFT OUTER JOIN ( @@ -32,5 +32,5 @@ FROM ( subq_14.ds ) subq_17 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_17.metric_time__day + time_spine_src_28006.ds = subq_17.metric_time__day ) subq_21 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_derived_fill_nulls_for_one_input_metric__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_derived_fill_nulls_for_one_input_metric__plan0.sql index c79cb0f78..9c6d01cbf 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_derived_fill_nulls_for_one_input_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_derived_fill_nulls_for_one_input_metric__plan0.sql @@ -34,7 +34,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter @@ -391,7 +391,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_derived_fill_nulls_for_one_input_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_derived_fill_nulls_for_one_input_metric__plan0_optimized.sql index 9109c1659..cdf309495 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_derived_fill_nulls_for_one_input_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_derived_fill_nulls_for_one_input_metric__plan0_optimized.sql @@ -20,7 +20,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_22.bookings AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 LEFT OUTER JOIN ( @@ -41,7 +41,7 @@ FROM ( metric_time__day ) subq_22 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_22.metric_time__day + time_spine_src_28006.ds = subq_22.metric_time__day ) subq_26 ) subq_27 FULL OUTER JOIN ( @@ -50,7 +50,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , SUM(subq_29.bookings) AS bookings_2_weeks_ago FROM ***************************.mf_time_spine time_spine_src_28006 INNER JOIN ( @@ -62,9 +62,9 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_29 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 14 day = subq_29.metric_time__day + time_spine_src_28006.ds - INTERVAL 14 day = subq_29.metric_time__day GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds ) subq_36 ON subq_27.metric_time__day = subq_36.metric_time__day diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by__plan0.sql index 9ad3d83ad..e61c6560d 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by__plan0.sql @@ -32,7 +32,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by__plan0_optimized.sql index da820c3bd..22b4d8635 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by__plan0_optimized.sql @@ -16,7 +16,7 @@ FROM ( -- Read From Time Spine 'mf_time_spine' -- Transform Time Dimension Columns SELECT - DATE_TRUNC('day', ds) AS metric_time__day + ds AS metric_time__day , DATE_TRUNC('month', ds) AS metric_time__month FROM ***************************.mf_time_spine time_spine_src_28006 ) subq_16 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql index b33427ead..32956d46d 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0.sql @@ -34,7 +34,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql index ba8466e77..4925b2418 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time__plan0_optimized.sql @@ -16,8 +16,8 @@ FROM ( -- Read From Time Spine 'mf_time_spine' -- Transform Time Dimension Columns SELECT - DATE_TRUNC('day', ds) AS booking__ds__day - , DATE_TRUNC('day', ds) AS metric_time__day + ds AS booking__ds__day + , ds AS metric_time__day , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine time_spine_src_28006 ) subq_16 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql index 4ff92475a..f0f1df7cb 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0.sql @@ -32,7 +32,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql index e3a970ac3..c55dfdb34 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_join_to_time_spine_with_filter_not_in_group_by_using_agg_time_and_metric_time__plan0_optimized.sql @@ -16,7 +16,7 @@ FROM ( -- Read From Time Spine 'mf_time_spine' -- Transform Time Dimension Columns SELECT - DATE_TRUNC('day', ds) AS metric_time__day + ds AS metric_time__day , DATE_TRUNC('month', ds) AS booking__ds__month FROM ***************************.mf_time_spine time_spine_src_28006 ) subq_16 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql index af7fe9e2d..7490846fb 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0.sql @@ -32,7 +32,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine_hour' SELECT - DATE_TRUNC('hour', time_spine_src_28005.ts) AS ts__hour + time_spine_src_28005.ts AS ts__hour , DATE_TRUNC('day', time_spine_src_28005.ts) AS ts__day , DATE_TRUNC('week', time_spine_src_28005.ts) AS ts__week , DATE_TRUNC('month', time_spine_src_28005.ts) AS ts__month diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql index 413be42cc..da330d7b4 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/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/DuckDB/test_join_to_time_spine_with_filter_smaller_than_group_by__plan0_optimized.sql @@ -17,7 +17,7 @@ FROM ( -- Transform Time Dimension Columns SELECT DATE_TRUNC('day', ts) AS metric_time__day - , DATE_TRUNC('hour', ts) AS metric_time__hour + , ts AS metric_time__hour FROM ***************************.mf_time_spine_hour time_spine_src_28005 ) subq_16 WHERE (metric_time__hour > '2020-01-01 00:09:00') AND (metric_time__day = '2020-01-01') diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filters__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filters__plan0.sql index 7b95ea184..d7b9ba746 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filters__plan0.sql @@ -44,7 +44,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filters__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filters__plan0_optimized.sql index ba5ecfb1f..b486d4a12 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filters__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_filters__plan0_optimized.sql @@ -22,7 +22,7 @@ FROM ( -- Read From Time Spine 'mf_time_spine' -- Transform Time Dimension Columns SELECT - DATE_TRUNC('day', ds) AS metric_time__day + ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week FROM ***************************.mf_time_spine time_spine_src_28006 ) subq_20 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_metric_time__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_metric_time__plan0.sql index ee8df1a2d..05cf9d9e9 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_metric_time__plan0.sql @@ -23,7 +23,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_metric_time__plan0_optimized.sql index 2266f176e..2f994958d 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_metric_time__plan0_optimized.sql @@ -9,7 +9,7 @@ SELECT FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_11.bookings AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 LEFT OUTER JOIN ( @@ -30,5 +30,5 @@ FROM ( metric_time__day ) subq_11 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_11.metric_time__day + time_spine_src_28006.ds = subq_11.metric_time__day ) subq_15 diff --git a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_month__plan0.sql b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_month__plan0.sql index 5c80aeb66..bc2012ed5 100644 --- a/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_month__plan0.sql +++ b/tests_metricflow/snapshots/test_fill_nulls_with_rendering.py/SqlQueryPlan/DuckDB/test_simple_fill_nulls_with_0_month__plan0.sql @@ -23,7 +23,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0.sql index 6756fb68e..3b1c88d56 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0.sql @@ -358,7 +358,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0_optimized.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0_optimized.sql index db8b28f05..79f6aef9b 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0_optimized.sql @@ -48,7 +48,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_21 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 14 day = subq_21.metric_time__day + time_spine_src_28006.ds - INTERVAL 14 day = subq_21.metric_time__day GROUP BY EXTRACT(isodow FROM time_spine_src_28006.ds) ) subq_28 diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_sub_daily_metric_time__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_sub_daily_metric_time__plan0.sql index dc2421475..36141a474 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_sub_daily_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_sub_daily_metric_time__plan0.sql @@ -41,7 +41,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine_millisecond' SELECT - DATE_TRUNC('millisecond', time_spine_src_28002.ts) AS ts__millisecond + time_spine_src_28002.ts AS ts__millisecond , DATE_TRUNC('second', time_spine_src_28002.ts) AS ts__second , DATE_TRUNC('minute', time_spine_src_28002.ts) AS ts__minute , DATE_TRUNC('hour', time_spine_src_28002.ts) AS ts__hour diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_sub_daily_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_sub_daily_metric_time__plan0_optimized.sql index 23111a50f..c801bbd64 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_sub_daily_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_sub_daily_metric_time__plan0_optimized.sql @@ -6,7 +6,7 @@ sql_engine: DuckDB -- Metric Time Dimension 'ts' -- Pass Only Elements: ['metric_time__millisecond',] SELECT - DATE_TRUNC('millisecond', ts) AS metric_time__millisecond + ts AS metric_time__millisecond FROM ***************************.mf_time_spine_millisecond time_spine_src_28002 GROUP BY - DATE_TRUNC('millisecond', ts) + ts diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_granularity_overrides_metric_default_granularity__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_granularity_overrides_metric_default_granularity__plan0.sql index a7fb1cf47..97979a296 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_granularity_overrides_metric_default_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_granularity_overrides_metric_default_granularity__plan0.sql @@ -23,7 +23,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine_hour' SELECT - DATE_TRUNC('hour', time_spine_src_28005.ts) AS ts__hour + time_spine_src_28005.ts AS ts__hour , DATE_TRUNC('day', time_spine_src_28005.ts) AS ts__day , DATE_TRUNC('week', time_spine_src_28005.ts) AS ts__week , DATE_TRUNC('month', time_spine_src_28005.ts) AS ts__month diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_granularity_overrides_metric_default_granularity__plan0_optimized.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_granularity_overrides_metric_default_granularity__plan0_optimized.sql index 73167104b..ea9ced6c5 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_granularity_overrides_metric_default_granularity__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_granularity_overrides_metric_default_granularity__plan0_optimized.sql @@ -5,7 +5,7 @@ sql_engine: DuckDB -- Join to Time Spine Dataset -- Compute Metrics via Expressions SELECT - DATE_TRUNC('hour', time_spine_src_28005.ts) AS metric_time__hour + time_spine_src_28005.ts AS metric_time__hour , subq_11.archived_users AS subdaily_join_to_time_spine_metric FROM ***************************.mf_time_spine_hour time_spine_src_28005 LEFT OUTER JOIN ( @@ -26,4 +26,4 @@ LEFT OUTER JOIN ( metric_time__hour ) subq_11 ON - DATE_TRUNC('hour', time_spine_src_28005.ts) = subq_11.metric_time__hour + time_spine_src_28005.ts = subq_11.metric_time__hour diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_join_to_time_spine_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_join_to_time_spine_metric__plan0.sql index 3a30287e7..6bfb266bd 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_join_to_time_spine_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_join_to_time_spine_metric__plan0.sql @@ -23,7 +23,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine_hour' SELECT - DATE_TRUNC('hour', time_spine_src_28005.ts) AS ts__hour + time_spine_src_28005.ts AS ts__hour , DATE_TRUNC('day', time_spine_src_28005.ts) AS ts__day , DATE_TRUNC('week', time_spine_src_28005.ts) AS ts__week , DATE_TRUNC('month', time_spine_src_28005.ts) AS ts__month diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_join_to_time_spine_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_join_to_time_spine_metric__plan0_optimized.sql index dff65fd22..e30c1c235 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_join_to_time_spine_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_join_to_time_spine_metric__plan0_optimized.sql @@ -5,7 +5,7 @@ sql_engine: DuckDB -- Join to Time Spine Dataset -- Compute Metrics via Expressions SELECT - DATE_TRUNC('hour', time_spine_src_28005.ts) AS metric_time__hour + time_spine_src_28005.ts AS metric_time__hour , subq_11.archived_users AS subdaily_join_to_time_spine_metric FROM ***************************.mf_time_spine_hour time_spine_src_28005 LEFT OUTER JOIN ( @@ -26,4 +26,4 @@ LEFT OUTER JOIN ( metric_time__hour ) subq_11 ON - DATE_TRUNC('hour', time_spine_src_28005.ts) = subq_11.metric_time__hour + time_spine_src_28005.ts = subq_11.metric_time__hour diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_to_grain_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_to_grain_metric__plan0.sql index f574f478c..46c51280e 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_to_grain_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_to_grain_metric__plan0.sql @@ -226,7 +226,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine_hour' SELECT - DATE_TRUNC('hour', time_spine_src_28005.ts) AS ts__hour + time_spine_src_28005.ts AS ts__hour , DATE_TRUNC('day', time_spine_src_28005.ts) AS ts__day , DATE_TRUNC('week', time_spine_src_28005.ts) AS ts__week , DATE_TRUNC('month', time_spine_src_28005.ts) AS ts__month diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_to_grain_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_to_grain_metric__plan0_optimized.sql index a46faaae3..d1809f303 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_to_grain_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_to_grain_metric__plan0_optimized.sql @@ -12,7 +12,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('hour', time_spine_src_28005.ts) AS metric_time__hour + time_spine_src_28005.ts AS metric_time__hour , SUM(subq_10.archived_users) AS archived_users FROM ***************************.mf_time_spine_hour time_spine_src_28005 INNER JOIN ( @@ -24,7 +24,7 @@ FROM ( FROM ***************************.dim_users users_ds_source_src_28000 ) subq_10 ON - DATE_TRUNC('hour', DATE_TRUNC('hour', time_spine_src_28005.ts)) = subq_10.metric_time__hour + DATE_TRUNC('hour', time_spine_src_28005.ts) = subq_10.metric_time__hour GROUP BY - DATE_TRUNC('hour', time_spine_src_28005.ts) + time_spine_src_28005.ts ) subq_17 diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_window_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_window_metric__plan0.sql index 8f286de7d..6dfe1257a 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_window_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_window_metric__plan0.sql @@ -226,7 +226,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine_hour' SELECT - DATE_TRUNC('hour', time_spine_src_28005.ts) AS ts__hour + time_spine_src_28005.ts AS ts__hour , DATE_TRUNC('day', time_spine_src_28005.ts) AS ts__day , DATE_TRUNC('week', time_spine_src_28005.ts) AS ts__week , DATE_TRUNC('month', time_spine_src_28005.ts) AS ts__month diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_window_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_window_metric__plan0_optimized.sql index 405a72f5a..7d57881f4 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_window_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_offset_window_metric__plan0_optimized.sql @@ -12,7 +12,7 @@ FROM ( -- Aggregate Measures -- Compute Metrics via Expressions SELECT - DATE_TRUNC('hour', time_spine_src_28005.ts) AS metric_time__hour + time_spine_src_28005.ts AS metric_time__hour , SUM(subq_10.archived_users) AS archived_users FROM ***************************.mf_time_spine_hour time_spine_src_28005 INNER JOIN ( @@ -24,7 +24,7 @@ FROM ( FROM ***************************.dim_users users_ds_source_src_28000 ) subq_10 ON - DATE_TRUNC('hour', time_spine_src_28005.ts) - INTERVAL 1 hour = subq_10.metric_time__hour + time_spine_src_28005.ts - INTERVAL 1 hour = subq_10.metric_time__hour GROUP BY - DATE_TRUNC('hour', time_spine_src_28005.ts) + time_spine_src_28005.ts ) subq_17 diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_with_metric__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_with_metric__plan0.sql index 9cea3ca05..f7089fb16 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_with_metric__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_with_metric__plan0.sql @@ -33,7 +33,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine_hour' SELECT - DATE_TRUNC('hour', time_spine_src_28005.ts) AS ts__hour + time_spine_src_28005.ts AS ts__hour , DATE_TRUNC('day', time_spine_src_28005.ts) AS ts__day , DATE_TRUNC('week', time_spine_src_28005.ts) AS ts__week , DATE_TRUNC('month', time_spine_src_28005.ts) AS ts__month diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_with_metric__plan0_optimized.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_with_metric__plan0_optimized.sql index cf6f28b1b..88b189943 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_with_metric__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_with_metric__plan0_optimized.sql @@ -14,9 +14,9 @@ FROM ( -- Constrain Time Range to [2020-01-01T02:00:00, 2020-01-01T05:00:00] -- Pass Only Elements: ['metric_time__hour',] SELECT - DATE_TRUNC('hour', ts) AS metric_time__hour + ts AS metric_time__hour FROM ***************************.mf_time_spine_hour time_spine_src_28005 - WHERE DATE_TRUNC('hour', ts) BETWEEN '2020-01-01 02:00:00' AND '2020-01-01 05:00:00' + WHERE ts BETWEEN '2020-01-01 02:00:00' AND '2020-01-01 05:00:00' ) subq_19 LEFT OUTER JOIN ( -- Aggregate Measures diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_without_metrics__plan0.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_without_metrics__plan0.sql index 5e5c27334..88344e28c 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_without_metrics__plan0.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_without_metrics__plan0.sql @@ -70,7 +70,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine_second' SELECT - DATE_TRUNC('second', time_spine_src_28003.ts) AS ts__second + time_spine_src_28003.ts AS ts__second , DATE_TRUNC('minute', time_spine_src_28003.ts) AS ts__minute , DATE_TRUNC('hour', time_spine_src_28003.ts) AS ts__hour , DATE_TRUNC('day', time_spine_src_28003.ts) AS ts__day diff --git a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_without_metrics__plan0_optimized.sql b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_without_metrics__plan0_optimized.sql index 9be999237..a93637797 100644 --- a/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_without_metrics__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_granularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_subdaily_time_constraint_without_metrics__plan0_optimized.sql @@ -7,8 +7,8 @@ sql_engine: DuckDB -- Constrain Time Range to [2020-01-01T00:00:02, 2020-01-01T00:00:08] -- Pass Only Elements: ['metric_time__second',] SELECT - DATE_TRUNC('second', ts) AS metric_time__second + ts AS metric_time__second FROM ***************************.mf_time_spine_second time_spine_src_28003 -WHERE DATE_TRUNC('second', ts) BETWEEN '2020-01-01 00:00:02' AND '2020-01-01 00:00:08' +WHERE ts BETWEEN '2020-01-01 00:00:02' AND '2020-01-01 00:00:08' GROUP BY - DATE_TRUNC('second', ts) + ts diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_dimensions_with_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_dimensions_with_time_constraint__plan0.sql index eabaddbbb..4e6c37e31 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_dimensions_with_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_dimensions_with_time_constraint__plan0.sql @@ -224,7 +224,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_dimensions_with_time_constraint__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_dimensions_with_time_constraint__plan0_optimized.sql index ac73c82d9..157adfb13 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_dimensions_with_time_constraint__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_dimensions_with_time_constraint__plan0_optimized.sql @@ -6,7 +6,7 @@ sql_engine: DuckDB -- Constrain Time Range to [2020-01-01T00:00:00, 2020-01-03T00:00:00] -- Pass Only Elements: ['user__home_state_latest', 'listing__is_lux_latest', 'metric_time__day'] SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , listings_latest_src_28000.is_lux AS listing__is_lux_latest , users_latest_src_28000.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings_latest listings_latest_src_28000 @@ -16,8 +16,8 @@ FULL OUTER JOIN ***************************.dim_users_latest users_latest_src_28000 ON listings_latest_src_28000.user_id = users_latest_src_28000.user_id -WHERE DATE_TRUNC('day', time_spine_src_28006.ds) BETWEEN '2020-01-01' AND '2020-01-03' +WHERE time_spine_src_28006.ds BETWEEN '2020-01-01' AND '2020-01-03' GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds , listings_latest_src_28000.is_lux , users_latest_src_28000.home_state_latest diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_only__plan0.sql b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_only__plan0.sql index ae912b22a..23d24347e 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_only__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_only__plan0.sql @@ -37,7 +37,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_only__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_only__plan0_optimized.sql index cdff4696c..ccf06dbb5 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_only__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_only__plan0_optimized.sql @@ -8,7 +8,7 @@ sql_engine: DuckDB -- Metric Time Dimension 'ds' -- Pass Only Elements: ['metric_time__day',] SELECT - DATE_TRUNC('day', ds) AS metric_time__day + ds AS metric_time__day FROM ***************************.mf_time_spine time_spine_src_28006 GROUP BY - DATE_TRUNC('day', ds) + ds diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_quarter_alone__plan0.sql b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_quarter_alone__plan0.sql index a17fd7deb..3a6c104c9 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_quarter_alone__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_quarter_alone__plan0.sql @@ -35,7 +35,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_with_other_dimensions__plan0.sql b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_with_other_dimensions__plan0.sql index f77e84dea..73afc2b0c 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_with_other_dimensions__plan0.sql +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_with_other_dimensions__plan0.sql @@ -163,7 +163,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_with_other_dimensions__plan0_optimized.sql b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_with_other_dimensions__plan0_optimized.sql index ec1326b19..137d5c1d7 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_with_other_dimensions__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/DuckDB/test_metric_time_with_other_dimensions__plan0_optimized.sql @@ -5,7 +5,7 @@ sql_engine: DuckDB -- Join Standard Outputs -- Pass Only Elements: ['user__home_state_latest', 'listing__is_lux_latest', 'metric_time__day'] SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , listings_latest_src_28000.is_lux AS listing__is_lux_latest , users_latest_src_28000.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings_latest listings_latest_src_28000 @@ -16,6 +16,6 @@ FULL OUTER JOIN ON listings_latest_src_28000.user_id = users_latest_src_28000.user_id GROUP BY - DATE_TRUNC('day', time_spine_src_28006.ds) + time_spine_src_28006.ds , listings_latest_src_28000.is_lux , users_latest_src_28000.home_state_latest diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_dimensions_with_time_constraint__plan0.xml b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_dimensions_with_time_constraint__plan0.xml index 074322762..b4130ba0d 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_dimensions_with_time_constraint__plan0.xml +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_dimensions_with_time_constraint__plan0.xml @@ -803,22 +803,25 @@ test_filename: test_metric_time_without_metrics.py - - + + + + + - + - + - + - + diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_only__plan0.xml b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_only__plan0.xml index 52134afb7..8a132b16b 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_only__plan0.xml +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_only__plan0.xml @@ -84,11 +84,11 @@ docstring: - - - - - + + + + + diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_quarter_alone__plan0.xml b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_quarter_alone__plan0.xml index c3c4aa145..c219fcdab 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_quarter_alone__plan0.xml +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_quarter_alone__plan0.xml @@ -83,11 +83,11 @@ test_filename: test_metric_time_without_metrics.py - - - - - + + + + + diff --git a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_with_other_dimensions__plan0.xml b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_with_other_dimensions__plan0.xml index 18002e75b..581a156b0 100644 --- a/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_with_other_dimensions__plan0.xml +++ b/tests_metricflow/snapshots/test_metric_time_without_metrics.py/SqlQueryPlan/test_metric_time_with_other_dimensions__plan0.xml @@ -552,16 +552,19 @@ test_filename: test_metric_time_without_metrics.py - - + + + + + - + - + - + - + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql index b028734dd..ef528b6b8 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0.sql @@ -42,7 +42,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter @@ -645,7 +645,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter @@ -990,7 +990,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0_optimized.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0_optimized.sql index a440e5542..e7595b986 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_fill_nulls_time_spine_metric_predicate_pushdown__plan0_optimized.sql @@ -27,7 +27,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_41.listing__country_latest AS listing__country_latest , subq_41.bookings AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 @@ -67,7 +67,7 @@ FROM ( , listing__country_latest ) subq_41 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_41.metric_time__day + time_spine_src_28006.ds = subq_41.metric_time__day ) subq_45 ) subq_46 FULL OUTER JOIN ( @@ -79,7 +79,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_59.listing__country_latest AS listing__country_latest , subq_59.bookings AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 @@ -101,7 +101,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_48.listing AS listing , subq_48.booking__is_instant AS booking__is_instant , subq_48.bookings AS bookings @@ -117,7 +117,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_48 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 14 day = subq_48.metric_time__day + time_spine_src_28006.ds - INTERVAL 14 day = subq_48.metric_time__day ) subq_52 LEFT OUTER JOIN ***************************.dim_listings_latest listings_latest_src_28000 @@ -130,7 +130,7 @@ FROM ( , listing__country_latest ) subq_59 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_59.metric_time__day + time_spine_src_28006.ds = subq_59.metric_time__day ) subq_63 ) subq_64 ON diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_offset_metric_with_query_time_filters__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_offset_metric_with_query_time_filters__plan0.sql index 476c46e84..b6444d888 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_offset_metric_with_query_time_filters__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_offset_metric_with_query_time_filters__plan0.sql @@ -919,7 +919,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_offset_metric_with_query_time_filters__plan0_optimized.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_offset_metric_with_query_time_filters__plan0_optimized.sql index 8a9e6654d..f9105f81a 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_offset_metric_with_query_time_filters__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_offset_metric_with_query_time_filters__plan0_optimized.sql @@ -73,7 +73,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_36.listing AS listing , subq_36.booking__is_instant AS booking__is_instant , subq_36.bookings AS bookings @@ -89,7 +89,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_28000 ) subq_36 ON - DATE_TRUNC('day', time_spine_src_28006.ds) - INTERVAL 14 day = subq_36.metric_time__day + time_spine_src_28006.ds - INTERVAL 14 day = subq_36.metric_time__day ) subq_40 LEFT OUTER JOIN ***************************.dim_listings_latest listings_latest_src_28000 diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_pushdown_filter_application__plan0.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_pushdown_filter_application__plan0.sql index 5cd3e39bc..7d639689d 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_pushdown_filter_application__plan0.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_pushdown_filter_application__plan0.sql @@ -35,7 +35,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_pushdown_filter_application__plan0_optimized.sql b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_pushdown_filter_application__plan0_optimized.sql index 7bb3a620b..8ca9901da 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_pushdown_filter_application__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_predicate_pushdown_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_pushdown_filter_application__plan0_optimized.sql @@ -15,7 +15,7 @@ SELECT FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_14.booking__is_instant AS booking__is_instant , subq_14.bookings AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 @@ -42,6 +42,6 @@ FROM ( , booking__is_instant ) subq_14 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_14.metric_time__day + time_spine_src_28006.ds = subq_14.metric_time__day ) subq_18 WHERE booking__is_instant diff --git a/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time__plan0.sql b/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time__plan0.sql index e00c77834..5ae9455a2 100644 --- a/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time__plan0.sql @@ -42,7 +42,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time__plan0_optimized.sql index b7431d2e2..973ddc9b0 100644 --- a/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time__plan0_optimized.sql @@ -13,8 +13,8 @@ FROM ( -- Metric Time Dimension 'ds' -- Pass Only Elements: ['metric_time__day',] SELECT - DATE_TRUNC('day', ds) AS metric_time__day + ds AS metric_time__day FROM ***************************.mf_time_spine time_spine_src_28006 GROUP BY - DATE_TRUNC('day', ds) + ds ) subq_5 diff --git a/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time_week__plan0.sql b/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time_week__plan0.sql index 78ebabf36..3fed88edb 100644 --- a/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time_week__plan0.sql +++ b/tests_metricflow/snapshots/test_query_rendering.py/SqlQueryPlan/DuckDB/test_min_max_metric_time_week__plan0.sql @@ -42,7 +42,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_input_measure_constraint__plan0.sql b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_input_measure_constraint__plan0.sql index 072ba84ad..de9b4ae67 100644 --- a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_input_measure_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_input_measure_constraint__plan0.sql @@ -34,7 +34,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_input_measure_constraint__plan0_optimized.sql b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_input_measure_constraint__plan0_optimized.sql index 00a4cfcaf..ad75aec55 100644 --- a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_input_measure_constraint__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_input_measure_constraint__plan0_optimized.sql @@ -21,7 +21,7 @@ FROM ( -- Read From Time Spine 'mf_time_spine' -- Transform Time Dimension Columns SELECT - DATE_TRUNC('day', ds) AS metric_time__day + ds AS metric_time__day FROM ***************************.mf_time_spine time_spine_src_28006 ) subq_16 WHERE metric_time__day > '2020-01-01' diff --git a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_queried_time_constraint__plan0.sql b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_queried_time_constraint__plan0.sql index 1bfb02b13..23f94edf6 100644 --- a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_queried_time_constraint__plan0.sql +++ b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_queried_time_constraint__plan0.sql @@ -35,7 +35,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_queried_time_constraint__plan0_optimized.sql b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_queried_time_constraint__plan0_optimized.sql index 2566be75a..70c711ace 100644 --- a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_queried_time_constraint__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_with_queried_time_constraint__plan0_optimized.sql @@ -20,9 +20,9 @@ FROM ( -- Constrain Time Range to [2020-01-03T00:00:00, 2020-01-05T00:00:00] -- Pass Only Elements: ['metric_time__day',] SELECT - DATE_TRUNC('day', ds) AS metric_time__day + ds AS metric_time__day FROM ***************************.mf_time_spine time_spine_src_28006 - WHERE DATE_TRUNC('day', ds) BETWEEN '2020-01-03' AND '2020-01-05' + WHERE ds BETWEEN '2020-01-03' AND '2020-01-05' ) subq_19 LEFT OUTER JOIN ( -- Aggregate Measures diff --git a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine__plan0.sql b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine__plan0.sql index 11d9d5030..8a3e5a834 100644 --- a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine__plan0.sql +++ b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine__plan0.sql @@ -23,7 +23,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine__plan0_optimized.sql b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine__plan0_optimized.sql index ea92d9c51..7be71a09b 100644 --- a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine__plan0_optimized.sql @@ -5,7 +5,7 @@ sql_engine: DuckDB -- Join to Time Spine Dataset -- Compute Metrics via Expressions SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_11.bookings AS bookings_join_to_time_spine FROM ***************************.mf_time_spine time_spine_src_28006 LEFT OUTER JOIN ( @@ -26,4 +26,4 @@ LEFT OUTER JOIN ( metric_time__day ) subq_11 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_11.metric_time__day + time_spine_src_28006.ds = subq_11.metric_time__day diff --git a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_filter__plan0.sql b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_filter__plan0.sql index 94b6ac4cf..418ae5b38 100644 --- a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_filter__plan0.sql @@ -25,7 +25,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_filter__plan0_optimized.sql index 143780075..58b71e0dc 100644 --- a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_filter__plan0_optimized.sql @@ -11,7 +11,7 @@ SELECT FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_13.bookings AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 LEFT OUTER JOIN ( @@ -35,5 +35,5 @@ FROM ( metric_time__day ) subq_13 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_13.metric_time__day + time_spine_src_28006.ds = subq_13.metric_time__day ) subq_17 diff --git a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_queried_filter__plan0.sql b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_queried_filter__plan0.sql index 0b115cedf..3b4a44407 100644 --- a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_queried_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_queried_filter__plan0.sql @@ -33,7 +33,7 @@ FROM ( FROM ( -- Read From Time Spine 'mf_time_spine' SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS ds__day + time_spine_src_28006.ds AS ds__day , DATE_TRUNC('week', time_spine_src_28006.ds) AS ds__week , DATE_TRUNC('month', time_spine_src_28006.ds) AS ds__month , DATE_TRUNC('quarter', time_spine_src_28006.ds) AS ds__quarter diff --git a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_queried_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_queried_filter__plan0_optimized.sql index 8615fe56a..473dd7f25 100644 --- a/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_queried_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_time_spine_join_rendering.py/SqlQueryPlan/DuckDB/test_simple_join_to_time_spine_with_queried_filter__plan0_optimized.sql @@ -18,7 +18,7 @@ FROM ( FROM ( -- Join to Time Spine Dataset SELECT - DATE_TRUNC('day', time_spine_src_28006.ds) AS metric_time__day + time_spine_src_28006.ds AS metric_time__day , subq_14.booking__is_instant AS booking__is_instant , subq_14.bookings AS bookings FROM ***************************.mf_time_spine time_spine_src_28006 @@ -45,7 +45,7 @@ FROM ( , booking__is_instant ) subq_14 ON - DATE_TRUNC('day', time_spine_src_28006.ds) = subq_14.metric_time__day + time_spine_src_28006.ds = subq_14.metric_time__day ) subq_18 WHERE booking__is_instant ) subq_19