-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Previewing Recursive CTE's Throws Error "Recursive CTE in subquery are not supported." #803
Comments
Seconding this! I have a few instances where I need to use recursion, and it's annoying not to be able to build/test my work the same way I do for everything else. I get the same error, even though my queries run normally and do not error in the AWS Console/Redshift Query Editor, and dbt is able to build and test the resulting tables successfully. |
Thanks @Caitlin-Syntax! I think we're going to resolve this issue by changing the default behavior of |
Any news on this bug ? |
@ashrafkasmipfs you likely have a different issue if your pipelines are blocked. This only affects the Preview functionality in the Cloud IDE; it does not impact Build, Run, or Test functionality in the Cloud IDE (or elsewhere), and it does not affect Job execution. The problem here is that the Preview function wraps up the compiled SQL as a subquery to apply a LIMIT clause (e.g. |
I'm affected by this issue. We're using BigQuery instead of redshift. Our query runs just fine on BQ, yet I can't run / build the model in DBT. No matter what, it will run a select * FROM with my query below, thus throwing the following error: WITH RECURSIVE is only allowed at the top level of the SELECT, CREATE TABLE AS SELECT, CREATE VIEW, INSERT, EXPORT DATA statements.
|
Not working for me yet. Still getting the error: "Recursive CTE in subquery are not supported." |
@brooketran1 I saw the changed behavior after switching my Dev Environment from a pretty old version up to Cloud Versionless; I assume this hasn't been fixed in all older versions. If that isn't the issue for you/upgrading isn't an option for you, there are some templates for overriding |
Is this a new bug in dbt-redshift?
Current Behavior
When I preview a recursive CTE in dbt cloud IDE, I am getting an error
Recursive CTE in subquery are not supported.
The same recursive CTE query run successfully withdbt run
ordbt build
. It also works fine with other datawarehouse such as Snowflake.Expected Behavior
The Preview button should show successful output when previewed the recursive CTE query.
Steps To Reproduce
Relevant log output
dbt run
.Additional Context
No response
The text was updated successfully, but these errors were encountered: