diff --git a/.changes/unreleased/Fixes-20230814-231516.yaml b/.changes/unreleased/Fixes-20230814-231516.yaml new file mode 100644 index 0000000000..22b6c227fd --- /dev/null +++ b/.changes/unreleased/Fixes-20230814-231516.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Remove barrier to partition pruning certain time partition filter predicates +time: 2023-08-14T23:15:16.658262-07:00 +custom: + Author: tlento + Issue: "712" diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index ff703198de..f03808ea5c 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -83,7 +83,6 @@ ) from metricflow.sql.sql_exprs import ( SqlBetweenExpression, - SqlCastToTimestampExpression, SqlColumnReference, SqlColumnReferenceExpression, SqlDateTruncExpression, @@ -124,15 +123,11 @@ def _make_time_range_comparison_expr( column_name=column_alias, ) ), - start_expr=SqlCastToTimestampExpression( - arg=SqlStringLiteralExpression( - literal_value=time_range_constraint.start_time.strftime(ISO8601_PYTHON_FORMAT), - ) + start_expr=SqlStringLiteralExpression( + literal_value=time_range_constraint.start_time.strftime(ISO8601_PYTHON_FORMAT), ), - end_expr=SqlCastToTimestampExpression( - arg=SqlStringLiteralExpression( - literal_value=time_range_constraint.end_time.strftime(ISO8601_PYTHON_FORMAT), - ) + end_expr=SqlStringLiteralExpression( + literal_value=time_range_constraint.end_time.strftime(ISO8601_PYTHON_FORMAT), ), ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql index 27d9f67824..06be580abc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql @@ -74,4 +74,4 @@ FROM ( ) subq_0 ) subq_1 ) subq_2 -WHERE subq_2.metric_time__day BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2020-01-02' AS DATETIME) +WHERE subq_2.metric_time__day BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0_optimized.sql index db9d802481..bfc4959615 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0_optimized.sql @@ -8,4 +8,4 @@ SELECT , ds AS metric_time__day , 1 AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 -WHERE ds BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2020-01-02' AS DATETIME) +WHERE ds BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index b4a12e171d..ba476407ac 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2000-01-01' AS DATETIME) AND CAST('2020-01-01' AS DATETIME) + WHERE subq_1.metric_time__day BETWEEN '2000-01-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql index 4cfd715746..4602e31115 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC(created_at, month) AS ds__month , SUM(revenue) AS revenue_all_time FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2000-01-01' AS DATETIME) AND CAST('2020-01-01' AS DATETIME) +WHERE created_at BETWEEN '2000-01-01' AND '2020-01-01' GROUP BY ds__month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql index efdeecbcc6..e3b191fd39 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2019-12-01' AS DATETIME) AND CAST('2020-01-01' AS DATETIME) + WHERE subq_1.metric_time__day BETWEEN '2019-12-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0_optimized.sql index ecad01dd50..3b9dc85205 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC(created_at, month) AS ds__month , SUM(revenue) AS trailing_2_months_revenue FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2019-12-01' AS DATETIME) AND CAST('2020-01-01' AS DATETIME) +WHERE created_at BETWEEN '2019-12-01' AND '2020-01-01' GROUP BY ds__month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 0a1260c8f2..5cd3449766 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2021-01-01' AS DATETIME) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql index fe078da551..3b6ed20f77 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2021-01-01' AS DATETIME) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql index 2e4a3d3058..d349d8f43c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2021-01-01' AS DATETIME) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql index 97af46ee7c..6fce290360 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2021-01-01' AS DATETIME) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql index 2f15877925..9ac5fff310 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2021-01-01' AS DATETIME) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0_optimized.sql index 304f6433f7..c35fc3c24d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2021-01-01' AS DATETIME) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql index 7fa857bacf..d8dd356837 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql @@ -191,7 +191,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_10001 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2020-01-01' AS DATETIME) + WHERE subq_1.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_2 ) subq_3 ) subq_4 @@ -327,7 +327,7 @@ CROSS JOIN ( FROM ***************************.dim_listings_latest listings_latest_src_10004 ) subq_6 ) subq_7 - WHERE subq_7.metric_time__day BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2020-01-01' AS DATETIME) + WHERE subq_7.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_8 ) subq_9 ) subq_10 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0_optimized.sql index b552b26bc7..74dcbb71f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( SELECT SUM(1) AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 - WHERE ds BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2020-01-01' AS DATETIME) + WHERE ds BETWEEN '2020-01-01' AND '2020-01-01' ) subq_17 CROSS JOIN ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,5 +26,5 @@ CROSS JOIN ( SELECT SUM(1) AS listings FROM ***************************.dim_listings_latest listings_latest_src_10004 - WHERE created_at BETWEEN CAST('2020-01-01' AS DATETIME) AND CAST('2020-01-01' AS DATETIME) + WHERE created_at BETWEEN '2020-01-01' AND '2020-01-01' ) subq_23 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql index 20d4bfeee4..4ca35f2544 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql @@ -74,4 +74,4 @@ FROM ( ) subq_0 ) subq_1 ) subq_2 -WHERE subq_2.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-02' AS TIMESTAMP) +WHERE subq_2.metric_time__day BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0_optimized.sql index b6e1205325..bfc4959615 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0_optimized.sql @@ -8,4 +8,4 @@ SELECT , ds AS metric_time__day , 1 AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 -WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-02' AS TIMESTAMP) +WHERE ds BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 401ec1aba8..0addae9160 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2000-01-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql index 49e1fa955f..c420ef636f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_all_time FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) +WHERE created_at BETWEEN '2000-01-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql index 3281cd0ffb..e1d641e04d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2019-12-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0_optimized.sql index 59babb640a..e3387b51e4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS trailing_2_months_revenue FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) +WHERE created_at BETWEEN '2019-12-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index c495d21956..6ed1bd4e99 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql index 462075945a..6a4ced8cd8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql index 0c6621ccb9..22702f0c48 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql index d47c01a644..f5c740c47c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql index b2a4d823e6..027f20ea5b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0_optimized.sql index 895767fd45..4afadfc929 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql index c141cd7f0f..5c9089deaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql @@ -191,7 +191,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_10001 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_2 ) subq_3 ) subq_4 @@ -327,7 +327,7 @@ CROSS JOIN ( FROM ***************************.dim_listings_latest listings_latest_src_10004 ) subq_6 ) subq_7 - WHERE subq_7.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_7.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_8 ) subq_9 ) subq_10 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0_optimized.sql index dee1ac93da..74dcbb71f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( SELECT SUM(1) AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2020-01-01' ) subq_17 CROSS JOIN ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,5 +26,5 @@ CROSS JOIN ( SELECT SUM(1) AS listings FROM ***************************.dim_listings_latest listings_latest_src_10004 - WHERE created_at BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE created_at BETWEEN '2020-01-01' AND '2020-01-01' ) subq_23 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql index 20d4bfeee4..4ca35f2544 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql @@ -74,4 +74,4 @@ FROM ( ) subq_0 ) subq_1 ) subq_2 -WHERE subq_2.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-02' AS TIMESTAMP) +WHERE subq_2.metric_time__day BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0_optimized.sql index b6e1205325..bfc4959615 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0_optimized.sql @@ -8,4 +8,4 @@ SELECT , ds AS metric_time__day , 1 AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 -WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-02' AS TIMESTAMP) +WHERE ds BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 401ec1aba8..0addae9160 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2000-01-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql index 49e1fa955f..c420ef636f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_all_time FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) +WHERE created_at BETWEEN '2000-01-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql index 3281cd0ffb..e1d641e04d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2019-12-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0_optimized.sql index 59babb640a..e3387b51e4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS trailing_2_months_revenue FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) +WHERE created_at BETWEEN '2019-12-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index c495d21956..6ed1bd4e99 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql index 462075945a..6a4ced8cd8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql index 6fcaea55d2..0834ca012d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql index 71c517d807..4a9399b1f2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql index b2a4d823e6..027f20ea5b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0_optimized.sql index 895767fd45..4afadfc929 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql index c141cd7f0f..5c9089deaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql @@ -191,7 +191,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_10001 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_2 ) subq_3 ) subq_4 @@ -327,7 +327,7 @@ CROSS JOIN ( FROM ***************************.dim_listings_latest listings_latest_src_10004 ) subq_6 ) subq_7 - WHERE subq_7.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_7.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_8 ) subq_9 ) subq_10 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0_optimized.sql index dee1ac93da..74dcbb71f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( SELECT SUM(1) AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2020-01-01' ) subq_17 CROSS JOIN ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,5 +26,5 @@ CROSS JOIN ( SELECT SUM(1) AS listings FROM ***************************.dim_listings_latest listings_latest_src_10004 - WHERE created_at BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE created_at BETWEEN '2020-01-01' AND '2020-01-01' ) subq_23 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql index 20d4bfeee4..4ca35f2544 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql @@ -74,4 +74,4 @@ FROM ( ) subq_0 ) subq_1 ) subq_2 -WHERE subq_2.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-02' AS TIMESTAMP) +WHERE subq_2.metric_time__day BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0_optimized.sql index b6e1205325..bfc4959615 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0_optimized.sql @@ -8,4 +8,4 @@ SELECT , ds AS metric_time__day , 1 AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 -WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-02' AS TIMESTAMP) +WHERE ds BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 401ec1aba8..0addae9160 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2000-01-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql index 49e1fa955f..c420ef636f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_all_time FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) +WHERE created_at BETWEEN '2000-01-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql index 3281cd0ffb..e1d641e04d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2019-12-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0_optimized.sql index 59babb640a..e3387b51e4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS trailing_2_months_revenue FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) +WHERE created_at BETWEEN '2019-12-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index c495d21956..6ed1bd4e99 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql index 462075945a..6a4ced8cd8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql index 53496a9fa1..a26b98d66d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql index a803f1d92f..e117c67c83 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql index b2a4d823e6..027f20ea5b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0_optimized.sql index 895767fd45..4afadfc929 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql index c141cd7f0f..5c9089deaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql @@ -191,7 +191,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_10001 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_2 ) subq_3 ) subq_4 @@ -327,7 +327,7 @@ CROSS JOIN ( FROM ***************************.dim_listings_latest listings_latest_src_10004 ) subq_6 ) subq_7 - WHERE subq_7.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_7.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_8 ) subq_9 ) subq_10 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0_optimized.sql index dee1ac93da..74dcbb71f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( SELECT SUM(1) AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2020-01-01' ) subq_17 CROSS JOIN ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,5 +26,5 @@ CROSS JOIN ( SELECT SUM(1) AS listings FROM ***************************.dim_listings_latest listings_latest_src_10004 - WHERE created_at BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE created_at BETWEEN '2020-01-01' AND '2020-01-01' ) subq_23 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql index 20d4bfeee4..4ca35f2544 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql @@ -74,4 +74,4 @@ FROM ( ) subq_0 ) subq_1 ) subq_2 -WHERE subq_2.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-02' AS TIMESTAMP) +WHERE subq_2.metric_time__day BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0_optimized.sql index b6e1205325..bfc4959615 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0_optimized.sql @@ -8,4 +8,4 @@ SELECT , ds AS metric_time__day , 1 AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 -WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-02' AS TIMESTAMP) +WHERE ds BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 401ec1aba8..0addae9160 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2000-01-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql index 49e1fa955f..c420ef636f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_all_time FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) +WHERE created_at BETWEEN '2000-01-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql index 3281cd0ffb..e1d641e04d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2019-12-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0_optimized.sql index 59babb640a..e3387b51e4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS trailing_2_months_revenue FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) +WHERE created_at BETWEEN '2019-12-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index c495d21956..6ed1bd4e99 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql index 462075945a..6a4ced8cd8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql index 0c6621ccb9..22702f0c48 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql index d47c01a644..f5c740c47c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql index b2a4d823e6..027f20ea5b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0_optimized.sql index 895767fd45..4afadfc929 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql index c141cd7f0f..5c9089deaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql @@ -191,7 +191,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_10001 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_2 ) subq_3 ) subq_4 @@ -327,7 +327,7 @@ CROSS JOIN ( FROM ***************************.dim_listings_latest listings_latest_src_10004 ) subq_6 ) subq_7 - WHERE subq_7.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_7.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_8 ) subq_9 ) subq_10 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0_optimized.sql index dee1ac93da..74dcbb71f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( SELECT SUM(1) AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2020-01-01' ) subq_17 CROSS JOIN ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,5 +26,5 @@ CROSS JOIN ( SELECT SUM(1) AS listings FROM ***************************.dim_listings_latest listings_latest_src_10004 - WHERE created_at BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE created_at BETWEEN '2020-01-01' AND '2020-01-01' ) subq_23 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql index 20d4bfeee4..4ca35f2544 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql @@ -74,4 +74,4 @@ FROM ( ) subq_0 ) subq_1 ) subq_2 -WHERE subq_2.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-02' AS TIMESTAMP) +WHERE subq_2.metric_time__day BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0_optimized.sql index b6e1205325..bfc4959615 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0_optimized.sql @@ -8,4 +8,4 @@ SELECT , ds AS metric_time__day , 1 AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 -WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-02' AS TIMESTAMP) +WHERE ds BETWEEN '2020-01-01' AND '2020-01-02' diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 401ec1aba8..0addae9160 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2000-01-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql index 49e1fa955f..c420ef636f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS revenue_all_time FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2000-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) +WHERE created_at BETWEEN '2000-01-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql index 3281cd0ffb..e1d641e04d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql @@ -74,7 +74,7 @@ FROM ( FROM ***************************.fct_revenue revenue_src_10006 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2019-12-01' AND '2020-01-01' ) subq_2 ) subq_4 GROUP BY diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0_optimized.sql index 59babb640a..e3387b51e4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0_optimized.sql @@ -9,6 +9,6 @@ SELECT DATE_TRUNC('month', created_at) AS ds__month , SUM(revenue) AS trailing_2_months_revenue FROM ***************************.fct_revenue revenue_src_10006 -WHERE created_at BETWEEN CAST('2019-12-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) +WHERE created_at BETWEEN '2019-12-01' AND '2020-01-01' GROUP BY DATE_TRUNC('month', created_at) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index c495d21956..6ed1bd4e99 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql index 462075945a..6a4ced8cd8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql index 0c6621ccb9..22702f0c48 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql index d47c01a644..f5c740c47c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql index b2a4d823e6..027f20ea5b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql @@ -8,7 +8,7 @@ FROM ( SELECT subq_6.ds AS metric_time__day FROM ***************************.mf_time_spine subq_6 - WHERE subq_6.ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE subq_6.ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_5 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0_optimized.sql index 895767fd45..4afadfc929 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0_optimized.sql @@ -8,7 +8,7 @@ FROM ( SELECT ds AS metric_time__day FROM ***************************.mf_time_spine subq_13 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2021-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2021-01-01' ) subq_12 INNER JOIN ( -- Compute Metrics via Expressions diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql index c141cd7f0f..5c9089deaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql @@ -191,7 +191,7 @@ FROM ( FROM ***************************.fct_bookings bookings_source_src_10001 ) subq_0 ) subq_1 - WHERE subq_1.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_1.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_2 ) subq_3 ) subq_4 @@ -327,7 +327,7 @@ CROSS JOIN ( FROM ***************************.dim_listings_latest listings_latest_src_10004 ) subq_6 ) subq_7 - WHERE subq_7.metric_time__day BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE subq_7.metric_time__day BETWEEN '2020-01-01' AND '2020-01-01' ) subq_8 ) subq_9 ) subq_10 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0_optimized.sql index dee1ac93da..74dcbb71f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0_optimized.sql @@ -13,7 +13,7 @@ FROM ( SELECT SUM(1) AS bookings FROM ***************************.fct_bookings bookings_source_src_10001 - WHERE ds BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE ds BETWEEN '2020-01-01' AND '2020-01-01' ) subq_17 CROSS JOIN ( -- Read Elements From Semantic Model 'listings_latest' @@ -26,5 +26,5 @@ CROSS JOIN ( SELECT SUM(1) AS listings FROM ***************************.dim_listings_latest listings_latest_src_10004 - WHERE created_at BETWEEN CAST('2020-01-01' AS TIMESTAMP) AND CAST('2020-01-01' AS TIMESTAMP) + WHERE created_at BETWEEN '2020-01-01' AND '2020-01-01' ) subq_23