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

Pass Dialect to Column.DefaultValue #536

Merged
merged 4 commits into from
May 2, 2024
Merged

Conversation

nathan-artie
Copy link
Contributor

No description provided.

@@ -25,7 +25,7 @@ func BackfillColumn(cfg config.Config, dwh destination.DataWarehouse, column col
}

additionalDateFmts := cfg.SharedTransferConfig.TypingSettings.AdditionalDateFormats
defaultVal, err := column.DefaultValue(&columns.DefaultValueArgs{Escape: true, DestKind: dwh.Label()}, additionalDateFmts)
defaultVal, err := column.DefaultValue(dwh.Dialect(), additionalDateFmts)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place we call DefaultValue so I removed the Escape argument.

return fmt.Sprintf("JSON_PARSE(%s)", stringutil.Wrap(c.defaultValue, false)), nil
case constants.Snowflake:
case sql.SnowflakeDialect:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tang8330 it doesn't seem like we're doing anything for MS SQL here, do we need a case for it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we're not. We don't support backfill default values in MSSQL yet.

Do you want to leave a comment?

@nathan-artie nathan-artie marked this pull request as ready for review May 2, 2024 00:27
@nathan-artie nathan-artie requested a review from Tang8330 May 2, 2024 00:27
@nathan-artie nathan-artie changed the title Pass Dialog to Column.DefaultValue Pass Dialect to Column.DefaultValue May 2, 2024
@nathan-artie nathan-artie merged commit 4b77f47 into master May 2, 2024
1 check passed
@nathan-artie nathan-artie deleted the nv/dialect-to-default-func branch May 2, 2024 00:34
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 this pull request may close these issues.

2 participants