Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 23 min read Deep dive mediumAdept

A Deep Dive into Apache Parquet with ClickHouse - Part 2

Parquet files are organized into row groups, column chunks and pages, with dictionary, RLE/bit-packing and delta encodings plus footer metadata and min/max statistics that let readers push down projections and predicates. In ClickHouse, writing via INSERT INTO FUNCTION file/s3 gives predictable control over row group size through min_insert_block_size_bytes, min_insert_block_size_rows and output_format_parquet_row_group_size, whereas SELECT ... FORMAT Parquet tends to produce many small row groups that compress worse. The new ParquetMetadata input format exposes per-column encodings, compression and statistics. Benchmarks on the UK house price dataset show Parquet at 174–348 MB depending on codec, versus 3.5 GB for uncompressed CSV.

Assumes: columnar storage basicsSQLcompression codecs

Related posts

  • A Deep Dive into Apache Parquet with ClickHouse - Part 1

    ClickHouse mediumAdept

    ClickHouse can read and write Apache Parquet through its file and s3 table functions, using the same Parquet code in ClickHouse Local and ClickHouse Server. Examples on a 28M-row UK house price dataset show schema inspection with DESCRIBE and aggregation queries over local files, S3 objects and glob-matched file sets. Writes can go through INSERT INTO FUNCTION, INTO OUTFILE or FORMAT Parquet redirection, and PARTITION BY splits output into one file per year. INSERT INTO FUNCTION produces smaller files (243MB vs 291MB) than the client-side approaches, so it is recommended where possible.

  • ClickHouse and Parquet: A foundation for fast Lakehouse analytics

    ClickHouse mediumAdept

    ClickHouse queries Parquet files directly, without ingestion, through a format-specific reader that currently parses via Arrow and then converts into ClickHouse's in-memory format. Performance rests on two things: parallelism and I/O reduction. Parallelism comes from prefetch threads, parsing threads, file streams and processing lanes. File streams are computed as min(max_threads, num_files), and parsing threads per file as max(max_parsing_threads / num_files, 1), with EXPLAIN Pipeline examples showing the resulting plans. A third native reader, "Yet Another Parquet Reader", is in development to drop the Arrow layer and improve parallelism and I/O efficiency, and the current reader serves as the benchmark baseline.

  • ClickHouse Release 23.8

    ClickHouse mediumAdept

    ClickHouse 23.8 makes file reads much faster by using Parquet row-group min/max statistics to skip data, answering count() from file metadata, and pruning files via the _file virtual column without reading them. On a 126GiB PyPI Parquet dataset in GCS, a count dropped from 26.5s to 11.4s, a time-range filter from 84s to 35s, and a 10% filename sample from 4.6s to 0.6s. The release also adds the S3Queue table engine for streaming ingestion from S3. It tracks processed files in ClickHouse Keeper using an unordered mode (with TTL and file-count limits) or an ordered mode keyed on filenames. Direct querying of zip, tar and 7z archives via the file function is also new.

  • Improving Parquet Dedupe on Hugging Face Hub

    Hugging Face mediumAdept

    Byte-level content-defined chunking dedupes Parquet appends almost perfectly: 10,000 appended rows give 99.1% dedupe and need about 20MB of new storage. A single-row edit drops dedupe to 89% (230MB new) because absolute file offsets in ColumnChunk/ColumnMetaData headers change in every column header. Deleting a row shifts the fixed-size row groups, and since each column is compressed, everything after the deletion becomes new data; turning off compression fixes dedupe but nearly doubles file size. Splitting row groups by a hash of a key column (content-defined row groups) keeps both compression and dedupe, and the proposed fixes are relative offsets in the format and CDC-aware row grouping in Parquet writers.

  • ClickHouse Release 25.8

    ClickHouse mediumAdept

    ClickHouse 25.8 ships 45 features, 47 performance optimizations and 119 bug fixes. The headline is an experimental native Parquet reader (v3) that bypasses Apache Arrow. It reads columns within a row group concurrently, prefetches non-PREWHERE columns only after PREWHERE, and adds page-level min/max pruning, averaging 1.81× faster on ClickBench; in the demo a query drops from 1.5s to 0.7s. Also new: Hive-style partitioned writes via the S3 engine, Iceberg insert/delete/update/schema changes (experimental), Delta Lake writes and time travel, catalogs promoted to beta, and the _table virtual column available beyond merge().

The quest for software engineering knowledge.

Look:
Layout: