|
2 | 2 | # SPDX-License-Identifier: Apache-2.0 |
3 | 3 | # SPDX-FileCopyrightText: Copyright the Vortex contributors |
4 | 4 | # |
5 | | -# Runs SQL benchmarks (datafusion-bench, duckdb-bench, lance-bench) for the given targets. |
6 | | -# This script is used by the sql-benchmarks.yml workflow. |
| 5 | +# Runs SQL benchmarks (datafusion-bench, duckdb-bench, lance-bench, clickhouse-bench) |
| 6 | +# for the given targets. This script is used by the sql-benchmarks.yml workflow. |
7 | 7 | # |
8 | 8 | # Usage: |
9 | 9 | # run-sql-bench.sh <subcommand> <targets> [options] |
10 | 10 | # |
11 | 11 | # Arguments: |
12 | 12 | # subcommand The benchmark subcommand (e.g., tpch, clickbench, tpcds) |
13 | 13 | # targets Comma-separated list of engine:format pairs |
14 | | -# (e.g., "datafusion:parquet,datafusion:vortex,duckdb:parquet") |
| 14 | +# (e.g., "datafusion:parquet,datafusion:vortex,duckdb:parquet,clickhouse:parquet") |
15 | 15 | # |
16 | 16 | # Options: |
17 | 17 | # --scale-factor <sf> Scale factor for the benchmark (e.g., 1.0, 10.0) |
18 | 18 | # --iterations <n> Number of iterations to pass to each benchmark binary |
19 | 19 | # --remote-storage <url> Remote storage URL (e.g., s3://bucket/path/) |
20 | | -# If provided, runs in remote mode (no lance support). |
| 20 | +# If provided, runs in remote mode (no lance/clickhouse support). |
21 | 21 | # --benchmark-id <id> Benchmark ID for error messages (e.g., tpch-s3) |
22 | 22 |
|
23 | 23 | set -Eeu -o pipefail |
@@ -71,6 +71,13 @@ if $is_remote && echo "$targets" | grep -q 'lance'; then |
71 | 71 | exit 1 |
72 | 72 | fi |
73 | 73 |
|
| 74 | +# ClickHouse on remote storage is not supported. clickhouse-local reads local files only. |
| 75 | +if $is_remote && echo "$targets" | grep -q 'clickhouse:'; then |
| 76 | + echo "ERROR: ClickHouse benchmarks are not supported for remote storage." |
| 77 | + echo "Remove 'clickhouse:' targets for benchmark '${benchmark_id:-unknown}'." |
| 78 | + exit 1 |
| 79 | +fi |
| 80 | + |
74 | 81 | # Extract formats for each engine from the targets string. |
75 | 82 | # Example input: "datafusion:parquet,datafusion:vortex,datafusion:lance,duckdb:parquet" |
76 | 83 | # |
|
84 | 91 | df_formats=$(echo "$targets" | tr ',' '\n' | (grep '^datafusion:' | grep -v ':lance$' || true) | sed 's/datafusion://' | tr '\n' ',' | sed 's/,$//') |
85 | 92 | ddb_formats=$(echo "$targets" | tr ',' '\n' | (grep '^duckdb:' || true) | sed 's/duckdb://' | tr '\n' ',' | sed 's/,$//') |
86 | 93 | has_lance=$(echo "$targets" | grep -q 'datafusion:lance' && echo "true" || echo "false") |
| 94 | +has_clickhouse=$(echo "$targets" | grep -q 'clickhouse:' && echo "true" || echo "false") |
87 | 95 |
|
88 | 96 | # Build options string. |
89 | 97 | opts="" |
@@ -136,3 +144,14 @@ if ! $is_remote && [[ "$has_lance" == "true" ]] && [[ -f "target/release_debug/l |
136 | 144 |
|
137 | 145 | cat lance-results.json >> results.json |
138 | 146 | fi |
| 147 | + |
| 148 | +# ClickHouse-bench only runs for local benchmarks (clickhouse-local reads local files). |
| 149 | +if ! $is_remote && [[ "$has_clickhouse" == "true" ]] && [[ -f "target/release_debug/clickhouse-bench" ]]; then |
| 150 | + # shellcheck disable=SC2086 |
| 151 | + target/release_debug/clickhouse-bench "$subcommand" \ |
| 152 | + -d gh-json \ |
| 153 | + $opts \ |
| 154 | + -o ch-results.json |
| 155 | + |
| 156 | + cat ch-results.json >> results.json |
| 157 | +fi |
0 commit comments