From 81fc66d5133c60466fbbf27ed87dd21b765f7590 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 16 Dec 2024 12:38:16 -0800 Subject: [PATCH] Snapshots for other engines --- .../BigQuery/test_add_time_expr__plan0.sql | 10 ++++++++++ .../Databricks/test_add_time_expr__plan0.sql | 10 ++++++++++ .../Postgres/test_add_time_expr__plan0.sql | 10 ++++++++++ .../Redshift/test_add_time_expr__plan0.sql | 2 +- .../Snowflake/test_add_time_expr__plan0.sql | 10 ++++++++++ .../SqlQueryPlan/Trino/test_add_time_expr__plan0.sql | 10 ++++++++++ 6 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/BigQuery/test_add_time_expr__plan0.sql create mode 100644 tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Databricks/test_add_time_expr__plan0.sql create mode 100644 tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Postgres/test_add_time_expr__plan0.sql create mode 100644 tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Snowflake/test_add_time_expr__plan0.sql create mode 100644 tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Trino/test_add_time_expr__plan0.sql diff --git a/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/BigQuery/test_add_time_expr__plan0.sql b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/BigQuery/test_add_time_expr__plan0.sql new file mode 100644 index 000000000..90fc09ace --- /dev/null +++ b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/BigQuery/test_add_time_expr__plan0.sql @@ -0,0 +1,10 @@ +test_name: test_add_time_expr +test_filename: test_engine_specific_rendering.py +docstring: + Tests rendering of the SqlAddTimeExpr in a query. +sql_engine: BigQuery +--- +-- Test Add Time Expression +SELECT + DATE_ADD(CAST('2020-01-01' AS DATETIME), INTERVAL SqlExpressionRenderResult(sql='1', bind_parameter_set=SqlBindParameterSet(param_items=())) quarter) AS add_time +FROM foo.bar a diff --git a/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Databricks/test_add_time_expr__plan0.sql b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Databricks/test_add_time_expr__plan0.sql new file mode 100644 index 000000000..3f6f5e12d --- /dev/null +++ b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Databricks/test_add_time_expr__plan0.sql @@ -0,0 +1,10 @@ +test_name: test_add_time_expr +test_filename: test_engine_specific_rendering.py +docstring: + Tests rendering of the SqlAddTimeExpr in a query. +sql_engine: Databricks +--- +-- Test Add Time Expression +SELECT + DATEADD(month, (1 * 3), '2020-01-01') AS add_time +FROM foo.bar a diff --git a/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Postgres/test_add_time_expr__plan0.sql b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Postgres/test_add_time_expr__plan0.sql new file mode 100644 index 000000000..2be701942 --- /dev/null +++ b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Postgres/test_add_time_expr__plan0.sql @@ -0,0 +1,10 @@ +test_name: test_add_time_expr +test_filename: test_engine_specific_rendering.py +docstring: + Tests rendering of the SqlAddTimeExpr in a query. +sql_engine: Postgres +--- +-- Test Add Time Expression +SELECT + '2020-01-01' + MAKE_INTERVAL(months => (1 * 3)) AS add_time +FROM foo.bar a diff --git a/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Redshift/test_add_time_expr__plan0.sql b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Redshift/test_add_time_expr__plan0.sql index 5188a324e..bac4dc733 100644 --- a/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Redshift/test_add_time_expr__plan0.sql +++ b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Redshift/test_add_time_expr__plan0.sql @@ -4,7 +4,7 @@ docstring: Tests rendering of the SqlAddTimeExpr in a query. sql_engine: Redshift --- --- Test Approximate Discrete Percentile Expression +-- Test Add Time Expression SELECT DATEADD(month, (1 * 3), '2020-01-01') AS add_time FROM foo.bar a diff --git a/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Snowflake/test_add_time_expr__plan0.sql b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Snowflake/test_add_time_expr__plan0.sql new file mode 100644 index 000000000..b83e17338 --- /dev/null +++ b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Snowflake/test_add_time_expr__plan0.sql @@ -0,0 +1,10 @@ +test_name: test_add_time_expr +test_filename: test_engine_specific_rendering.py +docstring: + Tests rendering of the SqlAddTimeExpr in a query. +sql_engine: Snowflake +--- +-- Test Add Time Expression +SELECT + DATEADD(month, (1 * 3), '2020-01-01') AS add_time +FROM foo.bar a diff --git a/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Trino/test_add_time_expr__plan0.sql b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Trino/test_add_time_expr__plan0.sql new file mode 100644 index 000000000..b6bb21279 --- /dev/null +++ b/tests_metricflow/snapshots/test_engine_specific_rendering.py/SqlQueryPlan/Trino/test_add_time_expr__plan0.sql @@ -0,0 +1,10 @@ +test_name: test_add_time_expr +test_filename: test_engine_specific_rendering.py +docstring: + Tests rendering of the SqlAddTimeExpr in a query. +sql_engine: Trino +--- +-- Test Add Time Expression +SELECT + DATE_ADD('month', (1 * 3), '2020-01-01') AS add_time +FROM foo.bar a