Skip to content

Commit be09b41

Browse files
night-ciHearyShen
authored andcommitted
[fix][infra] correct SQL syntax and enable multiquery execution (#412)
fix(clickhouse-init): correct SQL syntax and enable multiquery execution - Add missing comma after `evaluator_weighted_score` column in `evaluation.sql` to fix ClickHouse table creation syntax error - Enable `--multiquery` flag in `clickhouse-client` invocation to support multiple SQL statements (including CREATE TABLE with skip indexes) in a single .sql file These changes ensure the initialization script runs successfully when bootstrap SQL files contain compound statements or skip index definitions.
1 parent 9b2cb3a commit be09b41

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

release/deployment/docker-compose/bootstrap/clickhouse-init/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ for file in $(ls /coze-loop-clickhouse-init/bootstrap/init-sql | grep '\.sql$');
5151
-u "${COZE_LOOP_CLICKHOUSE_USER}" \
5252
--password="${COZE_LOOP_CLICKHOUSE_PASSWORD}" \
5353
--database="${COZE_LOOP_CLICKHOUSE_DATABASE}" \
54+
--multiquery \
5455
< "/coze-loop-clickhouse-init/bootstrap/init-sql/${file}"
5556
i=$((i + 1))
5657
done

release/deployment/docker-compose/bootstrap/clickhouse-init/init-sql/evaluation.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS expt_turn_result_filter
2121
`created_at` DateTime,
2222
`updated_at` DateTime,
2323
`eval_target_metrics` Map(String, Int64),
24-
`evaluator_weighted_score` Float64
24+
`evaluator_weighted_score` Float64,
2525
INDEX idx_space_id space_id TYPE bloom_filter() GRANULARITY 1,
2626
INDEX idx_expt_id expt_id TYPE bloom_filter() GRANULARITY 1,
2727
INDEX idx_item_id item_id TYPE bloom_filter() GRANULARITY 1,

0 commit comments

Comments
 (0)