-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...flow/snapshots/test_cte_column_pruner.py/str/test_column_reference_expression__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
36 changes: 36 additions & 0 deletions
36
tests_metricflow/snapshots/test_cte_column_pruner.py/str/test_string_expression__result.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |