-
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] dbt build fails when flag restrict_direct_pg_catalog_access set True #914
Comments
@dave-tomkinson Thanks for the bug report. Would you be able to provide a model with column names and configs for one of the models that fails? You can redact the logic that goes into each column if you prefer. I need to know things like whether the columns are quoted or not, whether they are lowercase or uppercase, etc. I suspect that the SDK returns columns that do not match the case, or which are/aren't quoted as expected. This could cause dbt to attempt to add a column that's already there because of a scenario like One additional note, I'm making the assumption that this is an incremental model with |
I think we're getting 3 main categories of error.
The snippet of generated code where the error is:
In the case of the ones with relation already exists it does look like we have:
A sanitised example of a model with the error
All our column names are lower case with underscore separators. Hope that helps. I also noticed someone else having an issue with the flag in the dbt Redshift slack |
@dave-tomkinson can you share what packages you're depending on in your project? |
We did have Elementary but have removed it (only mentioning as I saw that someone else in the dbt slack channel said they thought that could be the issue). |
@dave-tomkinson I searched through the code and the two packages you identified and I can't find the |
Ah yes apologies, That is a custom macro, I thought I'd said that when I mentioned what it did above, but must have lost that in an edit before I posted. I get the same error as before in for this model (bear in mind we're getting 3 classes of error across 43 models, this is just one example, not all the models have that macro). From the logs, it looks like parsing our model is okay (the
Then this part is where the dbt generated code pulls from the temp table back to the main model table; there's no columns in the brackets or columns in the select clause for the insert.
Just in case though, the macro code is
|
Thanks for the information @dave-tomkinson. This gives me something to go on. I'll continue troubleshooting. |
Someone else posting on dbt Slack about facing the same issue. They post another example. |
Another example: #921 related to snapshots |
Is this a new bug in dbt-redshift?
Current Behavior
When I switch dbt cloud to versionless and I build with no flags set then the build works, but with Warnings to set the flag
restrict_direct_pg_catalog_access
When I set the flag
restrict_direct_pg_catalog_access
to True the build fails, with a number of tables (probably around 10%) FailingMostly with one of these Errors:
Setting it to False or removing the flag means the build works again.
Expected Behavior
The build to succeed with no Warnings.
Steps To Reproduce
In dbt cloud with the project version set to
versionless
Set the following flag in
dbt_project.yml
Run
dbt build
Relevant log output
No response
Environment
Additional Context
In the above
The text was updated successfully, but these errors were encountered: