Skip to content

Format

format reads an NDJSON stream on standard input. By default it renders one table per record kind; --html draws one file's bytemass (list columns) stream as a static column treemap page on standard output.

$ pqb table-file examples/quickstart.parquet | pqb bytemass | pqb format
column  type   codec         encoding  bytes  dict bytes  bytes/row  values
------  -----  ------------  --------  -----  ----------  ---------  ------
id      INT64  UNCOMPRESSED  dict        102          80      12.75       8
year    INT32  UNCOMPRESSED  dict         68          46       8.50       8
$ pqb table-file data/samples/delta_byte_array.parquet | pqb bytemass | pqb format --html > /tmp/report.html
$ cat docker/e2e-lakehouse/table.ndjson | pqb ls files | pqb bytemass | pqb format --html > /tmp/report.html

Open /tmp/report.html in a browser; no server is needed. The page embeds the file's records and loads the d3 modules it uses from a CDN.

flowchart LR
    file[Parquet / TableFile] --> bytemass[pqb bytemass]
    bytemass --> stream["Blob + Column lines"]
    stream --> format[pqb format --html]
    format --> html[report.html]

Tables

Without --html, the stream becomes tables: one section per record kind, columns from the curated type, and any record the type cannot hold rendered from its own keys. A record without a string name is skipped. A Blob record is structural — it exists so the next stage can read storage — so it is not a table row; its Column records are.

$ pqb table-file examples/quickstart.parquet | pqb list columns | pqb format
column  type   codec         encoding  bytes  dict bytes  bytes/row  values
------  -----  ------------  --------  -----  ----------  ---------  ------
id      INT64  UNCOMPRESSED  dict        102          80      12.75       8
year    INT32  UNCOMPRESSED  dict         68          46       8.50       8

HTML

--html reads one file's bytemass stream: a Blob record and its Column records. It draws a flat column treemap — one cell per column, sized by its on-disk bytes. The heading shows how many columns the file has, their total compressed bytes, the file's compression ratio when every column reported uncompressed bytes, and its row count. A cell's label shows the column name and humanBytes · ratio · B/row; hovering shows the column's codec, physical type, and value count. There is no drilldown: the page is one file.

A stream that names more than one file, carries a record that is not a Blob or Column, or has no columns fails before a page is written, so a pipeline that skipped bytemass is told what to run.

Whole metastore

make dbx-walk runs the walk against the live workspace and ends with the column table and one file's treemap page: once through Unity Catalog, once through Iceberg REST for the same catalog. The catalog levels cover every catalog; the table levels cover the one catalog the principal may read outside compute (PQB_WALK_CATALOG, default pqbench_ext). Both passes must emit the same measured columns, and the script fails when they differ.

$ pqb list catalogs \
>   | pqb list schemas \
>   | pqb list tables \
>   | jq -c 'select(.name | startswith("catalogs/pqbench_ext/"))' \
>   | pqb get table | pqb ls files | pqb list columns | pqb format

One live run: 5 catalogs and 36 schemas (412 table refs); the pqbench_ext refs (120) narrowed by the jq filter to 91 tables in 11 schemas, 224 files, and 12,995 Blob and Column records rendered as one table. The columns total 19,647,713,732 bytes against 19,651,902,193 on disk; the difference is Parquet footer and metadata, which no column owns.

The other catalogs stop before storage: samples refuses EXTERNAL USE SCHEMA to the walk's principal, dbx_samples is Databricks default storage, and workspace and system are views and system tables. The dbx-walk CI job runs the walk on every push and on non-draft pull requests from this repository; set PQB_WALK_PAGE and PQB_WALK_ICEBERG_PAGE to keep the two pages, which otherwise stay in the script's temp directory.