Skip to content

Commit 7c884ea

Browse files
committed
Update snapshots.
1 parent f71d586 commit 7c884ea

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
test_name: test_column_reference_expression
2+
test_filename: test_cte_column_pruner.py
3+
docstring:
4+
Test a column reference expression that does not specify a table alias.
5+
expectation_description:
6+
`cte_source_0__col_01` should be retained in the CTE.
7+
---
8+
optimizer:
9+
SqlColumnPrunerOptimizer
10+
11+
sql_before_optimizing:
12+
-- Top-level SELECT
13+
WITH cte_source_0 AS (
14+
-- CTE source 0
15+
SELECT
16+
test_table_alias.col_0 AS cte_source_0__col_0
17+
, test_table_alias.col_0 AS cte_source_0__col_1
18+
FROM test_schema.test_table test_table_alias
19+
)
20+
21+
SELECT
22+
cte_source_0__col_0 AS top_level__col_0
23+
FROM cte_source_0 cte_source_0_alias
24+
25+
sql_after_optimizing:
26+
-- Top-level SELECT
27+
WITH cte_source_0 AS (
28+
-- CTE source 0
29+
SELECT
30+
test_table_alias.col_0 AS cte_source_0__col_0
31+
FROM test_schema.test_table test_table_alias
32+
)
33+
34+
SELECT
35+
cte_source_0__col_0 AS top_level__col_0
36+
FROM cte_source_0 cte_source_0_alias
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
test_name: test_string_expression
2+
test_filename: test_cte_column_pruner.py
3+
docstring:
4+
Test a string expression that references a column in the cte.
5+
expectation_description:
6+
`cte_source_0__col_01` should be retained in the CTE.
7+
---
8+
optimizer:
9+
SqlColumnPrunerOptimizer
10+
11+
sql_before_optimizing:
12+
-- Top-level SELECT
13+
WITH cte_source_0 AS (
14+
-- CTE source 0
15+
SELECT
16+
test_table_alias.col_0 AS cte_source_0__col_0
17+
, test_table_alias.col_0 AS cte_source_0__col_1
18+
FROM test_schema.test_table test_table_alias
19+
)
20+
21+
SELECT
22+
cte_source_0__col_0 AS top_level__col_0
23+
FROM cte_source_0 cte_source_0_alias
24+
25+
sql_after_optimizing:
26+
-- Top-level SELECT
27+
WITH cte_source_0 AS (
28+
-- CTE source 0
29+
SELECT
30+
test_table_alias.col_0 AS cte_source_0__col_0
31+
FROM test_schema.test_table test_table_alias
32+
)
33+
34+
SELECT
35+
cte_source_0__col_0 AS top_level__col_0
36+
FROM cte_source_0 cte_source_0_alias

0 commit comments

Comments
 (0)