Skip to content

Commit

Permalink
fix: set alter_sync = 0 when add columns on cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
YenchangChan committed Apr 2, 2024
1 parent 63d97f4 commit fd3c332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion output/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func (c *ClickHouse) ChangeSchema(newKeys *sync.Map) (err error) {
}

alterTable := func(tbl, col string) error {
query := fmt.Sprintf("ALTER TABLE `%s`.`%s` %s %s;", c.dbName, tbl, onCluster, col)
query := fmt.Sprintf("ALTER TABLE `%s`.`%s` %s %s SETTINGS alter_sync = 0;", c.dbName, tbl, onCluster, col)
util.Logger.Info(fmt.Sprintf("executing sql=> %s", query), zap.String("task", taskCfg.Name))
return conn.Exec(query)
}
Expand Down

0 comments on commit fd3c332

Please sign in to comment.