Local analytics with ClickHouse

June 16, 2026 · View on GitHub

Runnable examples for analysing files and data sources on your laptop with clickhouse-local (the command line) and chDB (in-process ClickHouse for Python) — no server, no import step.

Each subfolder is a self-contained, runnable companion to a how-to article on clickhouse.com.

Folder convention

Every example folder follows the same shape:

local-analytics/<surface>-<topic>/
├── README.md        # code-first, terse; links to the companion article
├── generate.sh      # creates the sample data locally (no large binaries committed)
├── run.sh           # the exact commands from the article (CLI examples)  -- or --
├── run.ipynb / run.py   # the exact code from the article (chDB / Python examples)
└── expected_output.txt  # what you should see, so the example is self-verifying
  • <surface> is clickhouse-local or chdb.
  • Sample data is generated locally by generate.sh (using clickhouse local itself, where possible) so nothing large is committed to git.
  • run.sh / run.ipynb reproduce exactly the commands shown in the article.
  • The article is canonical for prose; this folder is canonical for code. They link to each other.

Index

FolderCompanion articleSurface
clickhouse-local-introWhat is clickhouse-local?clickhouse-local
clickhouse-local-parquetHow to query a Parquet file from the command lineclickhouse-local
clickhouse-local-csvHow to run SQL on a CSV fileclickhouse-local
clickhouse-local-logsHow to analyze log files with SQLclickhouse-local
what-is-parquet-fileWhat is a Parquet file?clickhouse-local
chdb-parquetHow to read a Parquet file in PythonchDB
chdb-jsonHow to read a JSON file in PythonchDB

File-format reads — clickhouse-local (CLI)

FolderCompanion articleSurface
clickhouse-local-avroHow to read an Avro fileclickhouse-local
clickhouse-local-avro-confluentRead Avro from a schema registry with clickhouse-localclickhouse-local
clickhouse-local-bsonHow to query a BSON fileclickhouse-local
clickhouse-local-compressedHow to query a compressed file (gzip, zstd) from the command lineclickhouse-local
clickhouse-local-custom-delimiterHow to read a file with a custom delimiterclickhouse-local
clickhouse-local-featherHow to read a Feather file from the command lineclickhouse-local
clickhouse-local-formParse url-encoded form data with SQLclickhouse-local
clickhouse-local-jsonHow to query a JSON file with SQLclickhouse-local
clickhouse-local-json-linesHow to query a JSON Lines fileclickhouse-local
clickhouse-local-jsonlHow to run SQL on a JSONL fileclickhouse-local
clickhouse-local-messagepackHow to read a MessagePack fileclickhouse-local
clickhouse-local-mysqldumpHow to query a mysqldump file without importingclickhouse-local
clickhouse-local-nativeHow to read a ClickHouse Native format fileclickhouse-local
clickhouse-local-ndjsonHow to query an NDJSON file with SQLclickhouse-local
clickhouse-local-nested-jsonHow to query nested JSON with SQLclickhouse-local
clickhouse-local-npyHow to read a .npy (NumPy) file with SQLclickhouse-local
clickhouse-local-orcHow to read an ORC file from the command lineclickhouse-local
clickhouse-local-pipe-delimitedHow to read a pipe-delimited fileclickhouse-local
clickhouse-local-regexpHow to parse a log file with regex in SQLclickhouse-local
clickhouse-local-rowbinaryHow to read a RowBinary fileclickhouse-local
clickhouse-local-semicolonHow to read a semicolon-separated fileclickhouse-local
clickhouse-local-tsvHow to read a TSV fileclickhouse-local

File-format reads — chDB (Python)

FolderCompanion articleSurface
chdb-arrowHow to read an Arrow file in Python (and query it with SQL)chDB
chdb-avroHow to read an Avro file in Python (and query it with SQL)chDB
chdb-bsonHow to read a BSON file in Python and query it with SQLchDB
chdb-csvHow to read a CSV file in Python (and query it with SQL)chDB
chdb-featherHow to read a Feather file in Python (and query it with SQL)chDB
chdb-flatten-nested-jsonHow to flatten nested JSON in PythonchDB
chdb-jsonlHow to read a JSONL file in Python and query it with SQLchDB
chdb-messagepackHow to read a MessagePack file in Python (and query it with SQL)chDB
chdb-ndjsonHow to read an NDJSON file in Python and query it with SQLchDB
chdb-npyHow to read a .npy file in Python (and query it with SQL)chDB
chdb-orcHow to read an ORC file in Python (and query it with SQL)chDB
chdb-tsvHow to read a TSV file in Python and query it with SQLchDB

Special read angles

FolderCompanion articleSurface
chdb-rest-apiHow to query an API with SQL in PythonchDB
clickhouse-local-multiple-filesRun SQL across multiple CSV or Parquet filesclickhouse-local
clickhouse-local-rest-apiHow to query a REST API with SQLclickhouse-local

Format conversions

FolderCompanion articleSurface
convert-arrow-to-csvHow to convert Arrow to CSVclickhouse-local
convert-arrow-to-parquetHow to convert Arrow to Parquetclickhouse-local
convert-avro-to-csvHow to convert Avro to CSVclickhouse-local
convert-avro-to-jsonHow to convert Avro to JSONclickhouse-local
convert-avro-to-parquetHow to convert Avro to Parquetclickhouse-local
convert-bson-to-csvConvert BSON to CSVclickhouse-local
convert-bson-to-jsonHow to convert BSON to JSONclickhouse-local
convert-csv-to-arrowHow to convert CSV to Arrowclickhouse-local
convert-csv-to-avroHow to convert CSV to Avroclickhouse-local
convert-csv-to-jsonHow to convert CSV to JSONclickhouse-local
convert-csv-to-jsonlHow to convert CSV to JSONLclickhouse-local
convert-csv-to-ndjsonHow to convert CSV to NDJSONclickhouse-local
convert-csv-to-orcHow to convert CSV to ORCclickhouse-local
convert-csv-to-parquetHow to convert CSV to Parquetclickhouse-local
convert-csv-to-tsvHow to convert CSV to TSVclickhouse-local
convert-json-to-csvHow to convert JSON to CSVclickhouse-local
convert-json-to-jsonlHow to convert JSON to JSONLclickhouse-local
convert-json-to-parquetHow to convert JSON to Parquetclickhouse-local
convert-json-to-tsvHow to convert JSON to TSVclickhouse-local
convert-jsonl-to-csvHow to convert JSONL to CSVclickhouse-local
convert-jsonl-to-jsonHow to convert JSONL to JSONclickhouse-local
convert-jsonl-to-parquetHow to convert JSONL to Parquetclickhouse-local
convert-messagepack-to-csvHow to convert MessagePack to CSVclickhouse-local
convert-messagepack-to-jsonHow to convert MessagePack to JSONclickhouse-local
convert-ndjson-to-csvHow to convert NDJSON to CSVclickhouse-local
convert-ndjson-to-parquetHow to convert NDJSON to Parquetclickhouse-local
convert-npy-to-csvHow to convert NPY to CSVclickhouse-local
convert-npy-to-parquetHow to convert NPY to Parquetclickhouse-local
convert-orc-to-csvHow to convert ORC to CSVclickhouse-local
convert-orc-to-jsonHow to convert ORC to JSONclickhouse-local
convert-orc-to-parquetHow to convert ORC to Parquetclickhouse-local
convert-parquet-to-arrowHow to convert Parquet to Arrowclickhouse-local
convert-parquet-to-avroHow to convert Parquet to Avroclickhouse-local
convert-parquet-to-csvHow to convert Parquet to CSVclickhouse-local
convert-parquet-to-jsonHow to convert Parquet to JSONclickhouse-local
convert-parquet-to-jsonlHow to convert Parquet to JSONLclickhouse-local
convert-parquet-to-ndjsonHow to convert Parquet to NDJSONclickhouse-local
convert-parquet-to-orcHow to convert Parquet to ORCclickhouse-local
convert-parquet-to-tsvHow to convert Parquet to TSVclickhouse-local
convert-tsv-to-csvHow to convert TSV to CSVclickhouse-local
convert-tsv-to-jsonHow to convert TSV to JSONclickhouse-local
convert-tsv-to-parquetHow to convert TSV to Parquetclickhouse-local

Format definitions

FolderCompanion articleSurface
orc-file-formatORC file formatclickhouse-local
what-is-a-tsv-fileWhat is a TSV file?clickhouse-local
what-is-an-avro-fileWhat is an Avro file?clickhouse-local
what-is-an-npy-fileWhat is an .npy file?clickhouse-local
what-is-bsonWhat is a BSON file?clickhouse-local
what-is-messagepackWhat is MessagePack?clickhouse-local
what-is-ndjsonWhat is NDJSON / JSON Lines?clickhouse-local
what-is-protobufWhat is Protobuf?clickhouse-local

Requirements

  • clickhouse — install with clickhousectl:

    curl https://clickhouse.com/cli | sh   # install clickhousectl
    clickhousectl local use latest         # download ClickHouse and put it on your PATH
    

    This puts clickhouse on your PATH; invoke local mode as clickhouse local.

  • For the Python (chDB) examples: pip install chdb pandas pyarrow.