mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
19 lines
432 B
Bash
Executable File
19 lines
432 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
QUERIES_FILE="queries.sql"
|
|
TABLE=$1
|
|
TRIES=3
|
|
|
|
cat "$QUERIES_FILE" | sed "s/{table}/${TABLE}/g" | while read query; do
|
|
sync
|
|
echo 3 | sudo tee /proc/sys/vm/drop_caches >/dev/null
|
|
|
|
echo -n "["
|
|
for i in $(seq 1 $TRIES); do
|
|
RES=$(clickhouse-client --time --format=Null --query="$query" 2>&1)
|
|
[[ "$?" == "0" ]] && echo -n "${RES}" || echo -n "null"
|
|
[[ "$i" != $TRIES ]] && echo -n ", "
|
|
done
|
|
echo "],"
|
|
done
|