fix: change the order of local and distributed table (#4565)

This commit is contained in:
Srikanth Chekuri 2024-02-17 22:05:33 +05:30 committed by GitHub
parent 0c59953cb5
commit c4bbbf372c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3665,7 +3665,7 @@ func (r *ClickHouseReader) UpdateLogField(ctx context.Context, field *model.Upda
return &model.ApiError{Err: err, Typ: model.ErrorInternal} return &model.ApiError{Err: err, Typ: model.ErrorInternal}
} }
for _, table := range []string{r.logsLocalTable, r.logsTable} { for _, table := range []string{r.logsTable, r.logsLocalTable} {
// drop materialized column from logs table // drop materialized column from logs table
query := "ALTER TABLE %s.%s ON CLUSTER %s DROP COLUMN IF EXISTS %s " query := "ALTER TABLE %s.%s ON CLUSTER %s DROP COLUMN IF EXISTS %s "
err := r.db.Exec(ctx, fmt.Sprintf(query, err := r.db.Exec(ctx, fmt.Sprintf(query,