Skip to content

SQL Planner doesn't distinguish normal CTEs from the recursive ones. #3713

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
isidentical opened this issue Oct 4, 2022 · 0 comments · Fixed by #3714
Closed

SQL Planner doesn't distinguish normal CTEs from the recursive ones. #3713

isidentical opened this issue Oct 4, 2022 · 0 comments · Fixed by #3714
Labels
bug Something isn't working

Comments

@isidentical
Copy link
Contributor

Describe the bug
Recursive CTE support for datafusion is still in the planning stage, and it is tracked in #462. But the SQL planner still doesn't rejects the recursive CTEs and let them silently fail (or work, depending on the internal implementation).

To Reproduce
Steps to reproduce the behavior:

WITH RECURSIVE numbers(n) AS (
    SELECT 1 as n
  UNION
    SELECT n + 1 as n FROM numbers WHERE n < 10
)
SELECT * FROM numbers;

Running the query above would result with a cryptic error:

Plan("'datafusion.public.numbers' not found")

Expected behavior
It should fail immediately (even before processing the sub-expressions of the CTE) if the RECURSIVE property is used.

Additional context
Implementation regarding recursive CTEs for datafusion is being discussed here.

@isidentical isidentical added the bug Something isn't working label Oct 4, 2022
@isidentical isidentical changed the title SQL Planner doesn't distungish normal CTEs from the recursive ones. SQL Planner doesn't distinguish normal CTEs from the recursive ones. Oct 4, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant