Skip to content

Commit

Permalink
Update snapshots.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Feb 21, 2025
1 parent f71d586 commit 7c884ea
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
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
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

0 comments on commit 7c884ea

Please sign in to comment.