Open-Source Wikis

/

ClickHouse

/

Apps

/

Utilities

clickhouse/clickhouse

Utilities

A grab-bag of operator tools dispatched from the same clickhouse binary. The full list is in Apps → catalog. This page covers the ones a ClickHouse engineer is most likely to reach for.

clickhouse compressor

Source: programs/compressor/.

Compresses or decompresses a stream using ClickHouse's column codecs (LZ4, LZ4HC, ZSTD, Delta, T64, Gorilla, FPC, DoubleDelta, …). Useful when you want to inspect or rebuild a single column file from a part.

clickhouse compressor --codec 'ZSTD(3)' < in > out.zstd
clickhouse compressor --decompress < part_column.bin > raw.bin

The codec catalog lives in src/Compression/.

clickhouse format

Source: programs/format/.

Pretty-prints or normalizes SQL through the parser. Useful for diffing queries and for embedding a canonical form into tests.

echo 'select 1+2 as x, count() from t group by x order by x desc' | clickhouse format

By default it formats; with --obfuscate it replaces identifiers and literals with placeholders. With --oneline it strips line breaks. The implementation is a thin wrapper around src/Parsers/parseQuery.cpp and the AST formatters.

clickhouse obfuscator

Source: programs/obfuscator/.

Anonymises a dataset while preserving statistical properties (cardinalities, distributions, length histograms). Used internally to share repro datasets without exposing real data.

clickhouse obfuscator --structure 'name String, age UInt8, ip String' \
                      --input-format Values --output-format Values \
                      --seed 42 < input > scrubbed

The obfuscation algorithm lives entirely under programs/obfuscator/Obfuscator.cpp.

clickhouse disks

Source: programs/disks/.

A REPL/CLI that operates on any disk configured under <storage_configuration> in config.xml — local FS, S3, Azure, HDFS, web, encrypted, cached. You can ls, read, write, mv, rm against an S3 bucket as if it were a directory, using the same code path the server uses.

clickhouse disks --config-file /etc/clickhouse-server/config.xml \
                 --disk s3_disk \
                 --query 'list /'

Implemented on top of IDisk (src/Disks/IDisk.h) — see IO and disks.

clickhouse benchmark

Source: programs/benchmark/.

Issues a fixed query (or a list of queries) against a server with N concurrent connections for T seconds, then prints latency and throughput percentiles. The repository's stress and perf-comparison jobs in CI are essentially benchmark runs with carefully chosen queries.

clickhouse git-import

Source: programs/git-import/.

Imports a git repository's commit/file/line metadata into a set of ClickHouse tables, so you can run SQL over your engineering history (commit churn, file lifetimes, contributor activity). The schema is documented in the source.

clickhouse static-files-disk-uploader

Source: programs/static-files-disk-uploader/.

Bulk-uploads a directory tree into an object-storage disk. Used when bootstrapping a web disk (which serves a directory of pre-built parts read-only) or seeding an S3-backed installation.

clickhouse extract-from-config

Source: programs/extract-from-config/.

Reads a single value out of config.xml from the command line. Used by init scripts and systemd units to read e.g. <path> and <tcp_port> without depending on xmllint.

clickhouse extract-from-config --config-file=/etc/clickhouse-server/config.xml --key=path

clickhouse install / start / stop / status / restart

Source: programs/install/.

Self-installation onto a host: drops the binary into /usr/bin, creates clickhouse user, lays down /etc/clickhouse-server/config.xml, configures systemd. Useful for single-binary deployments without the .deb/.rpm packaging.

clickhouse check-marks / clickhouse checksum-for-compressed-block

Forensics tools for inspecting MergeTree mark files and recomputing block-level checksums. Used when diagnosing a corrupted part.

clickhouse zookeeper-dump-tree / zookeeper-remove-by-list

One-off ZooKeeper maintenance tools. The first dumps a subtree, the second deletes a list of paths in a controlled way. Both date back to the pre-Keeper era; they still work against clickhouse-keeper thanks to wire compatibility.

clickhouse hash-binary

A tiny tool inlined into programs/main.cpp:

int mainEntryClickHouseHashBinary(int, char **)
{
    std::cout << getHashOfLoadedBinaryHex();
    return 0;
}

It prints the hash of the running binary, intentionally without a trailing newline so that:

objcopy --add-section .clickhouse.hash=<(./clickhouse hash-binary) clickhouse

stamps the hash back into the binary's own section.

clickhouse su

Source: programs/su/. A small su clone used by the official Docker entry point to drop privileges to the clickhouse user before exec'ing the server.

clickhouse docker-init

Source: programs/docker-init/. The official Docker entry point: applies user/permission fixups, sources environment, then exec'es into server.

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Utilities – ClickHouse wiki | Factory