-
Notifications
You must be signed in to change notification settings - Fork 56
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
fix: snapshots failing because of wrong mysql colum quoting #171
fix: snapshots failing because of wrong mysql colum quoting #171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some comments, hopefully they're helpful. It'd would also be great if you'd be able to add a unit test for this new functionality.
dbt/include/mariadb/macros/materializations/snapshot/create_columns.sql
Outdated
Show resolved
Hide resolved
dbt/include/mariadb/macros/materializations/snapshot/create_columns.sql
Outdated
Show resolved
Hide resolved
dbt/include/mariadb/macros/materializations/snapshot/create_columns.sql
Outdated
Show resolved
Hide resolved
dbt/include/mariadb/macros/materializations/snapshot/create_columns.sql
Outdated
Show resolved
Hide resolved
dbt/include/mariadb/macros/materializations/snapshot/create_columns.sql
Outdated
Show resolved
Hide resolved
dbt/include/mariadb/macros/materializations/snapshot/create_columns.sql
Outdated
Show resolved
Hide resolved
Something like this is better ? Thanks for the reviews guys |
@@ -59,7 +70,7 @@ | |||
| rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY') | |||
| list %} | |||
|
|||
{% do create_columns(target_relation, missing_columns) %} | |||
{% do mysql5__create_columns(target_relation, missing_columns) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change (and the others like it) is not necessary. The create_columns()
macro will automatically call the adapter's specific macro if one exists (which it now does).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made this change myself so that we can get this merged.
Sorry for the delay in taking a look at your changes. This is looking a lot better, and I've just got the one new comment. It'd also be great if you'd be able to add some tests around this, although I'd be willing to merge this without them given the small scope of the changes. |
Description
When I do snapshots on a table on which i add columns: it use the function (if I read correctly the file dbt/include/mariadb/macros/materializations/snapshot/snapshot.sql)
{% do create_columns(target_relation, missing_columns) %}
which compiles into (for my source table
users
with a new columnteam
) intoalter table
sandbox.users_snapshotadd column "team" varchar(10);
But it needs to be add column
team
to work in mysqlChecklist
CHANGELOG.md
with information about my change