Skip to content

Commit d973747

Browse files
committed
fix(bulker): snowflake: properly handle reserved column names
1 parent 15e2648 commit d973747

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

bulkerlib/implementations/sql/bigquery.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ func (bq *BigQuery) CopyTables(ctx context.Context, targetTable *Table, sourceTa
242242
columnsString := strings.Join(quotedColumns, ",")
243243
updateSet := make([]string, len(quotedColumns))
244244
for i, name := range quotedColumns {
245-
n := forceQuote(name)
246-
updateSet[i] = fmt.Sprintf("T.%s = S.%s", n, n)
245+
updateSet[i] = fmt.Sprintf("T.%s = S.%s", name, name)
247246
}
248247
var joinConditions []string
249248
targetTable.PKFields.ForEach(func(pkField string) {
@@ -1175,10 +1174,3 @@ func (bq *BigQuery) RunJob(ctx context.Context, runner JobRunner, jobDescription
11751174
return job, state, nil
11761175
}
11771176
}
1178-
1179-
func forceQuote(identifier string) string {
1180-
if strings.HasPrefix(identifier, "`") && strings.HasSuffix(identifier, "`") {
1181-
return identifier
1182-
}
1183-
return "`" + identifier + "`"
1184-
}

0 commit comments

Comments
 (0)