feat: implement CTEs logic in sqlglot (#33518)

This commit is contained in:
Beto Dealmeida
2025-05-28 08:38:00 -04:00
committed by GitHub
parent deef923825
commit e205846845
4 changed files with 178 additions and 26 deletions

View File

@@ -217,17 +217,21 @@ select 'EUR' as cur
select * from currency union all select * from currency_2
"""
),
dedent(
"""WITH currency as (
select 'INR' as cur
),
currency_2 as (
select 'EUR' as cur
),
__cte AS (
select * from currency union all select * from currency_2
)"""
),
"""WITH currency AS (
SELECT
'INR' AS cur
), currency_2 AS (
SELECT
'EUR' AS cur
), __cte AS (
SELECT
*
FROM currency
UNION ALL
SELECT
*
FROM currency_2
)""",
),
(
"SELECT 1 as cnt",