Skip to content
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

add sqlserver__alter_relation_add_remove_columns() #177

Closed
sergey-vdovin opened this issue Nov 10, 2021 · 2 comments · Fixed by #188
Closed

add sqlserver__alter_relation_add_remove_columns() #177

sergey-vdovin opened this issue Nov 10, 2021 · 2 comments · Fixed by #188

Comments

@sergey-vdovin
Copy link

missing implementation for alter_relation_add_remove_columns macro in 0.21.0rc1

https://github.com/dbt-labs/dbt-core/blob/8442fb66a591c4f5353f8baaaaf62f846c5f5171/core/dbt/include/global_project/macros/adapters/columns.sql

leads to incompatible with t-sql default statement generation "alter table xxx add column" when trying to use "append_new_columns" option for incremental models

@dataders dataders changed the title missing implementation for alter_relation_add_remove_columns macro in 0.21.0rc1 add sqlserevr__alter_relation_add_remove_columns() Nov 11, 2021
@dataders
Copy link
Collaborator

thanks for identifying! can you tell me how this macro needs to be changed? or would be willing to open a pull request for this?

@sergey-vdovin
Copy link
Author

at first glance looks as simple as removing "column" from "add column" but needs to be tested carefully: the second point in our discussion on slack was a bit more spooky:

https://getdbt.slack.com/archives/CMRMDDQ9W/p1636568890048600?thread_ts=1636568890.048600&cid=CMRMDDQ9W
for 0.21:
apparently there are some problems with "append_new_columns" https://docs.getdbt.com/docs/building-a-dbt-project/building-models/configuring-incremental-models

  1. "alter table add column" is not valid in t-sql, "column" keyword should be remved
  2. some columns from other models are trying to get into the model - some problems with metadata collection - in the same statement as for the problem 1

@dataders dataders changed the title add sqlserevr__alter_relation_add_remove_columns() add sqlserver__alter_relation_add_remove_columns() Nov 30, 2021
dataders added a commit that referenced this issue Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants