From 8f8198c16303316809f65a72f7b0b58793885b15 Mon Sep 17 00:00:00 2001 From: Robin Tang Date: Tue, 30 Apr 2024 12:29:03 -0700 Subject: [PATCH] Escape Snowflake too. --- clients/snowflake/snowflake.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/clients/snowflake/snowflake.go b/clients/snowflake/snowflake.go index 1f3f2c6fe..047da9dc0 100644 --- a/clients/snowflake/snowflake.go +++ b/clients/snowflake/snowflake.go @@ -15,9 +15,8 @@ import ( "github.com/artie-labs/transfer/lib/kafkalib" "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 maxRetries = 10 @@ -131,13 +130,12 @@ func (s *Store) reestablishConnection() error { 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