-
Notifications
You must be signed in to change notification settings - Fork 24
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
[dml] Remove buildColumnsUpdateFragment
argument
#556
Conversation
@@ -157,7 +157,7 @@ func (m *MergeArgument) GetParts() ([]string, error) { | |||
// UPDATE | |||
fmt.Sprintf(`UPDATE %s as c SET %s FROM %s as cc WHERE %s%s AND COALESCE(cc.%s, false) = false;`, | |||
// UPDATE table set col1 = cc. col1 | |||
m.TableID.FullyQualifiedName(), buildColumnsUpdateFragment(columns, m.Dialect, true), | |||
m.TableID.FullyQualifiedName(), buildColumnsUpdateFragment(columns, m.Dialect), |
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.
Delete column marker was removed https://github.com/artie-labs/transfer/pull/556/files#diff-e297e1a797fbb22e7fc1b6ee5ccd51774aa48d89253950cd1e6642ced703e334R144
@@ -261,7 +261,7 @@ WHEN NOT MATCHED AND IFNULL(cc.%s, false) = false THEN INSERT (%s) VALUES (%s);` | |||
// Delete | |||
m.Dialect.QuoteIdentifier(constants.DeleteColumnMarker), | |||
// Update | |||
m.Dialect.QuoteIdentifier(constants.DeleteColumnMarker), idempotentClause, buildColumnsUpdateFragment(m.Columns.GetColumns(), m.Dialect, true), | |||
m.Dialect.QuoteIdentifier(constants.DeleteColumnMarker), idempotentClause, buildColumnsUpdateFragment(columns, m.Dialect), |
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.
@@ -326,7 +326,7 @@ WHEN NOT MATCHED AND COALESCE(cc.%s, 1) = 0 THEN INSERT (%s) VALUES (%s);`, | |||
// Delete | |||
m.Dialect.QuoteIdentifier(constants.DeleteColumnMarker), | |||
// Update | |||
m.Dialect.QuoteIdentifier(constants.DeleteColumnMarker), idempotentClause, buildColumnsUpdateFragment(columns, m.Dialect, true), | |||
m.Dialect.QuoteIdentifier(constants.DeleteColumnMarker), idempotentClause, buildColumnsUpdateFragment(columns, m.Dialect), |
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.
Instead of passing
skipDeleteCol
tobuildColumnsUpdateFragment
, we'll just pass a slice of columns that already has the delete column marker removed.