liveBook · Manning

Parquet

As explained in DuckDB in Action

Parquet is a column-oriented file format for storing structured data together with schema and related metadata.

Parquet is a column-oriented format that stores structured data with schema metadata. DuckDB can query it directly, applying column selection and predicate pushdown before loading data, making it useful for data lakes and one-off analysis. section 1.7.1 section 10.4

Use Parquet when you need to:

  • Inspect an unfamiliar file as a table by retrieving its column names, types, and nullability with DESCRIBE. section 5.5
  • Inspect physical and logical types, repetition information, and other internal schema details through parquet_schema. section 5.5
  • Inspect row groups, statistics, compression, encodings, and compressed sizes through parquet_metadata. section 5.5
  • Export tables with selectable codecs, row-group sizes, multithreaded output, or ordering chosen for later query performance. section 10.3

Query and export without staging tables

Inspect an ATP rankings file with `DESCRIBE FROM 'atp/atp_rankings.parquet';`, then query it like a table: `FROM 'atp/atp_rankings.parquet' SELECT max(rank), max(points), max(player_id), max(height);`. For a larger table, export with `COPY (FROM users) TO 'users.parquet' (FORMAT PARQUET, CODEC 'SNAPPY', ROW_GROUP_SIZE 100000);` and read it using `SELECT count(*) FROM read_parquet('users.parquet');`. section 5.5 section 10.3

DESCRIBE FROM 'atp/atp_rankings.parquet';

Run the supplied DESCRIBE query to see how a Parquet file exposes its schema as relational output. section 5.5

Listing 10.26 Exporting the users table to Parquet
COPY (FROM users)
TO 'users.parquet'
(FORMAT PARQUET, CODEC 'SNAPPY', ROW_GROUP_SIZE 100000);
-- Run Time (s): real 10.582 user 62.737265 sys 65.422181

Use the supplied COPY statement as a concrete export template with SNAPPY compression and an explicit row-group size. section 10.3

How DuckDB in Action covers it

How deep it goes
Examines schemas, physical types, row-group statistics, compression, and pushdown, rather than treating Parquet as an opaque file.
Examples
Uses ATP rankings, Stack Overflow tables, and monthly New York taxi files to demonstrate inspection, export, and large-scale querying.
What it assumes
Assumes basic SQL for analysis while teaching direct file querying, schema inspection, and Parquet metadata progressively.
What you can do after
Apply it via DuckDB to inspect, query, export, compress, and benchmark structured datasets stored as files or cloud objects.
How it connects
Connects columnar storage with DuckDB, SQL, schema metadata, predicate pushdown, compression, and cloud storage.

Also explained in

Compare how 9 books explain Parquet →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of DuckDB in Action. The section links point to the parts of the book it draws on.