From 2449688440146fb3750af0eb32b52b24c4e48b64 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Tue, 30 Apr 2024 12:14:33 -0700 Subject: [PATCH] Call EscapeNameIfNecessary directly. --- clients/bigquery/bigquery.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clients/bigquery/bigquery.go b/clients/bigquery/bigquery.go index bddeb8c04..97cdc36e2 100644 --- a/clients/bigquery/bigquery.go +++ b/clients/bigquery/bigquery.go @@ -21,9 +21,9 @@ import ( "github.com/artie-labs/transfer/lib/logger" "github.com/artie-labs/transfer/lib/optimization" "github.com/artie-labs/transfer/lib/ptr" + "github.com/artie-labs/transfer/lib/sql" "github.com/artie-labs/transfer/lib/stringutil" "github.com/artie-labs/transfer/lib/typing" - "github.com/artie-labs/transfer/lib/typing/columns" ) const ( @@ -151,13 +151,12 @@ func (s *Store) putTable(ctx context.Context, tableID types.TableIdentifier, row func (s *Store) generateDedupeQueries(tableID, stagingTableID types.TableIdentifier, primaryKeys []string, topicConfig kafkalib.TopicConfig) []string { var primaryKeysEscaped []string for _, pk := range primaryKeys { - pkCol := columns.NewColumn(pk, typing.Invalid) - primaryKeysEscaped = append(primaryKeysEscaped, pkCol.Name(s.ShouldUppercaseEscapedNames(), s.Label())) + primaryKeysEscaped = append(primaryKeysEscaped, sql.EscapeNameIfNecessary(pk, s.ShouldUppercaseEscapedNames(), s.Label())) } orderColsToIterate := primaryKeysEscaped if topicConfig.IncludeArtieUpdatedAt { - orderColsToIterate = append(orderColsToIterate, constants.UpdateColumnMarker) + orderColsToIterate = append(orderColsToIterate, sql.EscapeNameIfNecessary(constants.UpdateColumnMarker, s.ShouldUppercaseEscapedNames(), s.Label())) } var orderByCols []string