Open preethi8p opened 1 year ago
Linking:
dbt-core
issue that's related (but was closed as stale
): https://github.com/dbt-labs/dbt-core/issues/4422dbt-core
: https://github.com/dbt-labs/dbt-core/pull/7025Have raised a Pull Request for the issue - Update columns.sql dbt-labs/dbt-core#7025
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
I hope this was accepted as a valid issue, so is this PR completed? How do I track? If yes, then please provide me the link to verify the same else please let me know the next step.
This was reported multiple times and covering a plurality of adapters:
Implementation detail was originally described here: https://github.com/dbt-labs/dbt-core/pull/7025#issuecomment-1606152211
In short:
{{ adapter.quote() }}
as described in dbt-labs/dbt-adapters#160 (comment)on_schema_change
tests for a column that contains a special character (/
, "
, etc.) or is a reserved keyword, e.g. from
.After doing a git grep "column\.name" dbt/
, here are three places I noticed in the code base to update:
Since the 3rd one is related to snapshots, ideally there would be at least one snapshot-specific functional test that needs a quoted identifier to handle a special character or reserved keyword.
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.
Its been too long I have opened this issue, now I don't even remember where to track back. Now I am not clear on all the comments, so please let me know if this can be published or not ? And what should be my next step towards this? TIA.
Is this a new bug in dbt-snowflake?
Current Behavior
We had few columns with "/" in the column names. During incremental runs, when dbt runs the alter statement to either add or drop a column it is failing with the below error in the global macro columns.sql ERROR_MESSAGE SQL compilation error: syntax error line 3 at position 12 unexpected '/'. image
Fix Modified global macro to add proper quoting to the column names during alter table statement.
Expected Behavior
We expect that the alter statements to add or drop columns, must run successfully without any failure. Basically if we have added a column in the previous layer(say load layer), and during incremental load in the next layer(raw layer) it should run the alter statement and add the column to the raw table. Please note it failed because it has a character "/" in the column name.
Steps To Reproduce
Relevant log output
Environment
Additional Context
No response