Skip to content

Commit

Permalink
change to add if not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik committed Oct 31, 2023
1 parent 0982cb7 commit 91df070
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flow/connectors/snowflake/snowflake.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ func (c *SnowflakeConnector) ReplayTableSchemaDeltas(flowJobName string,
return fmt.Errorf("failed to convert column type %s to snowflake type: %w",
addedColumn.ColumnType, err)
}
_, err = tableSchemaModifyTx.Exec(fmt.Sprintf("ALTER TABLE %s ADD COLUMN \"%s\" %s",
_, err = tableSchemaModifyTx.Exec(fmt.Sprintf("ALTER TABLE %s ADD COLUMN IF NOT EXISTS \"%s\" %s",
schemaDelta.DstTableName, strings.ToUpper(addedColumn.ColumnName), sfColtype))
if err != nil {
return fmt.Errorf("failed to add column %s for table %s: %w", addedColumn.ColumnName,
Expand Down

0 comments on commit 91df070

Please sign in to comment.