Skip to content

feat: add clickhouse-bench with auto-downloaded ClickHouse binary#6736

Open
fastio wants to merge 8 commits intovortex-data:developfrom
fastio:integration-clickhouse-benchmark-baseline
Open

feat: add clickhouse-bench with auto-downloaded ClickHouse binary#6736
fastio wants to merge 8 commits intovortex-data:developfrom
fastio:integration-clickhouse-benchmark-baseline

Conversation

@fastio
Copy link

@fastio fastio commented Mar 2, 2026

Introduce a new clickhouse-bench benchmark crate that runs ClickBench queries against Parquet data via clickhouse-local, providing a baseline for comparing Vortex performance against ClickHouse.

Key design decisions:

  • build.rs auto-downloads the full ClickHouse binary (with Parquet support) into target/clickhouse-local/, similar to how vortex-duckdb downloads the DuckDB library. This eliminates manual install steps and avoids issues with slim/homebrew builds lacking Parquet support.
  • The binary path is baked in via CLICKHOUSE_BINARY env at compile time; CLICKHOUSE_LOCAL env var allows runtime override.
  • ClickHouse-dialect SQL queries are maintained in a separate clickbench_clickhouse_queries.sql file (43 queries).
  • CI workflows updated to include clickhouse:parquet target in ClickBench benchmarks and conditionally build clickhouse-bench.

#6425

fastio added 2 commits March 2, 2026 18:12
Introduce a new clickhouse-bench benchmark crate that runs ClickBench
queries against Parquet data via clickhouse-local, providing a baseline
for comparing Vortex performance against ClickHouse.

Key design decisions:
- build.rs auto-downloads the full ClickHouse binary (with Parquet
  support) into target/clickhouse-local/, similar to how vortex-duckdb
  downloads the DuckDB library. This eliminates manual install steps
  and avoids issues with slim/homebrew builds lacking Parquet support.
- The binary path is baked in via CLICKHOUSE_BINARY env at compile time;
  CLICKHOUSE_LOCAL env var allows runtime override.
- ClickHouse-dialect SQL queries are maintained in a separate
  clickbench_clickhouse_queries.sql file (43 queries).
- CI workflows updated to include clickhouse:parquet target in
  ClickBench benchmarks and conditionally build clickhouse-bench.
Signed-off-by: Peng Jian <pengjian.uestc@gmail.com>
@myrrc myrrc self-requested a review March 2, 2026 10:32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this file is it difference to the already included one?

Copy link
Author

@fastio fastio Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I have removed the duplicate clickbench_clickhouse_queries.sql and validated with cargo check -p vortex-bench.

Copy link
Contributor

@myrrc myrrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think downloading untrusted binaries from internet via a build script is a good idea. We want first-class integration with duckdb thus we need to download its sources (although I'd not do it in build script as well), but we don't need such integration with Clickhouse yet.

My idea is to use clickhouse binary in CI (as it runs on Linux only) and require users to download it by hand if they want a local run. Benchmarking on MacOS doesn't make much sense anyway as vectorized instrustion set is different.

@fastio
Copy link
Author

fastio commented Mar 3, 2026

I don't think downloading untrusted binaries from internet via a build script is a good idea. We want first-class integration with duckdb thus we need to download its sources (although I'd not do it in build script as well), but we don't need such integration with Clickhouse yet.

My idea is to use clickhouse binary in CI (as it runs on Linux only) and require users to download it by hand if they want a local run. Benchmarking on MacOS doesn't make much sense anyway as vectorized instrustion set is different.

Agreed — removed the binary download from build.rs entirely. The clickhouse binary is now resolved at runtime: via CLICKHOUSE_BINARY env var or from $PATH. CI installs it via the official installer before building. Local users need to install it manually. No more untrusted binary downloads in the build script.

fastio added 2 commits March 3, 2026 21:10
…use from PATH

- Remove reqwest-based binary download from build.rs
- Resolve clickhouse binary via CLICKHOUSE_BINARY env var or $PATH at runtime
- Add CI step to install clickhouse before building when needed
- Fail with clear error message if binary is not found locally
- name: Install ClickHouse
if: contains(matrix.targets, 'clickhouse:')
run: |
curl https://clickhouse.com/ | sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not download the latest release file for our architecture from Github releases? We then don't need any installation and curl in general.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — updated CI to download the static binary directly from GitHub Releases (pined ClickHouse to LTS release v25.8.18.1 from GitHub Releases), no curl | sh or installation needed.

fastio added 2 commits March 4, 2026 10:38
- Pass subcommand arg to clickhouse-bench in run-sql-bench.sh for consistency
- Use BenchmarkArg + create_benchmark() in main.rs like other engines
- Replace `which` with `clickhouse local --version` for binary verification
- Pin ClickHouse to LTS release v25.8.18.1 from GitHub Releases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants