Skip to content

Commit

Permalink
match case to what it is on snowflake (prior to quoting) (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik authored Jun 28, 2023
1 parent 84a23de commit 27787ed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions flow/connectors/snowflake/qrep_avro_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,19 @@ func GenerateMergeCommand(
tempTableName string,
dstTable string,
) (string, error) {
// all cols are acquired from snowflake schema, so let us try to make upsert key cols match the case
// and also the watermark col, then the quoting should be fine
caseMatchedCols := map[string]string{}
for _, col := range allCols {
caseMatchedCols[strings.ToLower(col)] = col
}

for i, col := range upsertKeyCols {
upsertKeyCols[i] = caseMatchedCols[strings.ToLower(col)]
}

watermarkCol = caseMatchedCols[strings.ToLower(watermarkCol)]

upsertKeys := []string{}
partitionKeyCols := []string{}
for _, key := range upsertKeyCols {
Expand Down

0 comments on commit 27787ed

Please sign in to comment.