From 7c884ea94993a1519e447eaf67549c1e1db6878e Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 20 Feb 2025 23:06:44 -0800 Subject: [PATCH] Update snapshots. --- ...st_column_reference_expression__result.txt | 36 +++++++++++++++++++ .../str/test_string_expression__result.txt | 36 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 tests_metricflow/snapshots/test_cte_column_pruner.py/str/test_column_reference_expression__result.txt create mode 100644 tests_metricflow/snapshots/test_cte_column_pruner.py/str/test_string_expression__result.txt diff --git a/tests_metricflow/snapshots/test_cte_column_pruner.py/str/test_column_reference_expression__result.txt b/tests_metricflow/snapshots/test_cte_column_pruner.py/str/test_column_reference_expression__result.txt new file mode 100644 index 0000000000..fccfd349d0 --- /dev/null +++ b/tests_metricflow/snapshots/test_cte_column_pruner.py/str/test_column_reference_expression__result.txt @@ -0,0 +1,36 @@ +test_name: test_column_reference_expression +test_filename: test_cte_column_pruner.py +docstring: + Test a column reference expression that does not specify a table alias. +expectation_description: + `cte_source_0__col_01` should be retained in the CTE. +--- +optimizer: + SqlColumnPrunerOptimizer + +sql_before_optimizing: + -- Top-level SELECT + WITH cte_source_0 AS ( + -- CTE source 0 + SELECT + test_table_alias.col_0 AS cte_source_0__col_0 + , test_table_alias.col_0 AS cte_source_0__col_1 + FROM test_schema.test_table test_table_alias + ) + + SELECT + cte_source_0__col_0 AS top_level__col_0 + FROM cte_source_0 cte_source_0_alias + +sql_after_optimizing: + -- Top-level SELECT + WITH cte_source_0 AS ( + -- CTE source 0 + SELECT + test_table_alias.col_0 AS cte_source_0__col_0 + FROM test_schema.test_table test_table_alias + ) + + SELECT + cte_source_0__col_0 AS top_level__col_0 + FROM cte_source_0 cte_source_0_alias diff --git a/tests_metricflow/snapshots/test_cte_column_pruner.py/str/test_string_expression__result.txt b/tests_metricflow/snapshots/test_cte_column_pruner.py/str/test_string_expression__result.txt new file mode 100644 index 0000000000..da5900b7d5 --- /dev/null +++ b/tests_metricflow/snapshots/test_cte_column_pruner.py/str/test_string_expression__result.txt @@ -0,0 +1,36 @@ +test_name: test_string_expression +test_filename: test_cte_column_pruner.py +docstring: + Test a string expression that references a column in the cte. +expectation_description: + `cte_source_0__col_01` should be retained in the CTE. +--- +optimizer: + SqlColumnPrunerOptimizer + +sql_before_optimizing: + -- Top-level SELECT + WITH cte_source_0 AS ( + -- CTE source 0 + SELECT + test_table_alias.col_0 AS cte_source_0__col_0 + , test_table_alias.col_0 AS cte_source_0__col_1 + FROM test_schema.test_table test_table_alias + ) + + SELECT + cte_source_0__col_0 AS top_level__col_0 + FROM cte_source_0 cte_source_0_alias + +sql_after_optimizing: + -- Top-level SELECT + WITH cte_source_0 AS ( + -- CTE source 0 + SELECT + test_table_alias.col_0 AS cte_source_0__col_0 + FROM test_schema.test_table test_table_alias + ) + + SELECT + cte_source_0__col_0 AS top_level__col_0 + FROM cte_source_0 cte_source_0_alias