You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internally, the following ALTER TABLE statement is executed:
alter table `db`.`schema`.`table`
add columns (
new_column string
)
At this time, if the column name contains a hyphen, it will fail with the following error:
[INVALID_IDENTIFIER] The unquoted identifier column_name is invalid and must be back quoted as: `column_name`.
It would be helpful if you could either add an option to enclose column names with backticks when executing ALTER TABLE, or modify the SQL for ALTER TABLE itself.
It would be helpful if you could either add an option to enclose column names with backticks when executing ALTER TABLE, or modify the SQL for ALTER TABLE itself.
Describe alternatives you've considered
Update alter table statement or add options whether enclosing columns with backquote or not.
Additional context
NA
Who will this benefit?
Users managing tables which has hyphen named columns will get the benefit.
Are you interested in contributing this feature?
Yes, I'll support as much as possible.
The text was updated successfully, but these errors were encountered:
I believe this is coming from spark__alter_relation_add_remove_columns macro. Could you please file a bug against dbt-spark? I'll replace in dbt-databricks, but it would be nice to make them aware of the issue.
Describe the feature
When you define a model like the following and execute dbt run, new columns will be added if there are schema changes.
Internally, the following ALTER TABLE statement is executed:
At this time, if the column name contains a hyphen, it will fail with the following error:
It would be helpful if you could either add an option to enclose column names with backticks when executing ALTER TABLE, or modify the SQL for ALTER TABLE itself.
Describe alternatives you've considered
Update alter table statement or add options whether enclosing columns with backquote or not.
Additional context
NA
Who will this benefit?
Users managing tables which has hyphen named columns will get the benefit.
Are you interested in contributing this feature?
Yes, I'll support as much as possible.
The text was updated successfully, but these errors were encountered: