Skip to content

Commit

Permalink
wip: add failing test case
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgapp committed Jan 12, 2024
1 parent 61dc1a5 commit e0ea336
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions datafusion/sqllogictest/test_files/cte.slt
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,29 @@ SELECT * FROM my_cte t1, my_cte
6 5
6 5
6 6

# CTE within recursive CTE works and does not result in 'index out of bounds: the len is 0 but the index is 0'
query
WITH RECURSIVE "recursive_cte" AS (
SELECT 1 as "val"
UNION ALL (
WITH "sub_cte" AS (
SELECT
time,
1 as "val"
FROM
(SELECT DISTINCT "time" FROM "beg_account_balance")
)
SELECT
2 as "val"
FROM
"recursive_cte"
FULL JOIN "sub_cte" ON 1 = 1
WHERE
"recursive_cte"."val" < 2
)
)
SELECT
*
FROM
"recursive_cte";

0 comments on commit e0ea336

Please sign in to comment.