Skip to content

Commit

Permalink
Change to add column if not exists (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik authored Oct 31, 2023
1 parent 4ec38ae commit 243ff7b
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 @@ -456,7 +456,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 243ff7b

Please sign in to comment.