diff --git a/airbyte-integrations/connectors/destination-snowflake/src/main/java/io/airbyte/integrations/destination/snowflake/typing_deduping/SnowflakeSqlGenerator.java b/airbyte-integrations/connectors/destination-snowflake/src/main/java/io/airbyte/integrations/destination/snowflake/typing_deduping/SnowflakeSqlGenerator.java index 3309bdde7bff..8ed760f9a8d0 100644 --- a/airbyte-integrations/connectors/destination-snowflake/src/main/java/io/airbyte/integrations/destination/snowflake/typing_deduping/SnowflakeSqlGenerator.java +++ b/airbyte-integrations/connectors/destination-snowflake/src/main/java/io/airbyte/integrations/destination/snowflake/typing_deduping/SnowflakeSqlGenerator.java @@ -246,7 +246,7 @@ WHEN TYPEOF("_airbyte_data":"${column_name}") != 'ARRAY' String validatePrimaryKeys(final StreamId id, final List primaryKeys, final LinkedHashMap streamColumns) { - if (streamColumns.keySet().stream().anyMatch(c -> c.originalName().contains("`"))) { + if (primaryKeys.stream().anyMatch(c -> c.originalName().contains("`"))) { // TODO why is snowflake throwing a bizarre error when we try to use a column with a backtick in it? // E.g. even this trivial procedure fails: (it should return the string `'foo`bar') // execute immediate 'BEGIN RETURN \'foo`bar\'; END;'