diff --git a/clients/bigquery/append.go b/clients/bigquery/append.go index 22b18e5c8..8e4e221b0 100644 --- a/clients/bigquery/append.go +++ b/clients/bigquery/append.go @@ -8,5 +8,5 @@ import ( func (s *Store) Append(tableData *optimization.TableData) error { tableID := s.IdentifierFor(tableData.TopicConfig(), tableData.Name()) - return shared.Append(s, tableData, s.config, types.AppendOpts{TempTableID: tableID}) + return shared.Append(s, tableData, types.AppendOpts{TempTableID: tableID}) } diff --git a/clients/mssql/store.go b/clients/mssql/store.go index 17970eb52..e3a66e704 100644 --- a/clients/mssql/store.go +++ b/clients/mssql/store.go @@ -44,7 +44,7 @@ func (s *Store) Merge(tableData *optimization.TableData) error { func (s *Store) Append(tableData *optimization.TableData) error { tableID := s.IdentifierFor(tableData.TopicConfig(), tableData.Name()) - return shared.Append(s, tableData, s.config, types.AppendOpts{TempTableID: tableID}) + return shared.Append(s, tableData, types.AppendOpts{TempTableID: tableID}) } // specificIdentifierFor returns a MS SQL [TableIdentifier] for a [TopicConfig] + table name. diff --git a/clients/redshift/writes.go b/clients/redshift/writes.go index 167e34da2..fcaf08e67 100644 --- a/clients/redshift/writes.go +++ b/clients/redshift/writes.go @@ -14,7 +14,7 @@ func (s *Store) Append(tableData *optimization.TableData) error { // Redshift is slightly different, we'll load and create the temporary table via shared.Append // Then, we'll invoke `ALTER TABLE target APPEND FROM staging` to combine the diffs. temporaryTableID := shared.TempTableID(tableID, tableData.TempTableSuffix()) - if err := shared.Append(s, tableData, s.config, types.AppendOpts{TempTableID: temporaryTableID}); err != nil { + if err := shared.Append(s, tableData, types.AppendOpts{TempTableID: temporaryTableID}); err != nil { return err } diff --git a/clients/shared/append.go b/clients/shared/append.go index 07d38bb74..21c755194 100644 --- a/clients/shared/append.go +++ b/clients/shared/append.go @@ -3,7 +3,6 @@ package shared import ( "log/slog" - "github.com/artie-labs/transfer/lib/config" "github.com/artie-labs/transfer/lib/config/constants" "github.com/artie-labs/transfer/lib/destination" "github.com/artie-labs/transfer/lib/destination/ddl" @@ -13,7 +12,7 @@ import ( "github.com/artie-labs/transfer/lib/typing/columns" ) -func Append(dwh destination.DataWarehouse, tableData *optimization.TableData, cfg config.Config, opts types.AppendOpts) error { +func Append(dwh destination.DataWarehouse, tableData *optimization.TableData, opts types.AppendOpts) error { if tableData.ShouldSkipUpdate() { return nil } diff --git a/clients/shared/utils.go b/clients/shared/utils.go index dcc7bbe0f..2fefe7b2c 100644 --- a/clients/shared/utils.go +++ b/clients/shared/utils.go @@ -32,8 +32,7 @@ func BackfillColumn(cfg config.Config, dwh destination.DataWarehouse, column col return fmt.Errorf("failed to escape default value: %w", err) } - uppercaseEscNames := dwh.ShouldUppercaseEscapedNames() - escapedCol := column.Name(uppercaseEscNames, &sql.NameArgs{Escape: true, DestKind: dwh.Label()}) + escapedCol := column.Name(dwh.ShouldUppercaseEscapedNames(), &sql.NameArgs{Escape: true, DestKind: dwh.Label()}) // TODO: This is added because `default` is not technically a column that requires escaping, but it is required when it's in the where clause. // Once we escape everything by default, we can remove this patch of code. diff --git a/clients/snowflake/writes.go b/clients/snowflake/writes.go index 81a31509d..90bdda710 100644 --- a/clients/snowflake/writes.go +++ b/clients/snowflake/writes.go @@ -26,7 +26,7 @@ func (s *Store) Append(tableData *optimization.TableData) error { tableID := s.IdentifierFor(tableData.TopicConfig(), tableData.Name()) // TODO: For history mode - in the future, we could also have a separate stage name for history mode so we can enable parallel processing. - err = shared.Append(s, tableData, s.config, types.AppendOpts{ + err = shared.Append(s, tableData, types.AppendOpts{ TempTableID: tableID, AdditionalCopyClause: `FILE_FORMAT = (TYPE = 'csv' FIELD_DELIMITER= '\t' FIELD_OPTIONALLY_ENCLOSED_BY='"' NULL_IF='\\N' EMPTY_FIELD_AS_NULL=FALSE) PURGE = TRUE`, })