Skip to content

Core: Add Puffin files metadata table#17192

Open
yangshangqing95 wants to merge 1 commit into
apache:mainfrom
yangshangqing95:feat/puffin-metadata-tables
Open

Core: Add Puffin files metadata table#17192
yangshangqing95 wants to merge 1 commit into
apache:mainfrom
yangshangqing95:feat/puffin-metadata-tables

Conversation

@yangshangqing95

Copy link
Copy Markdown

Summary

This PR adds a new puffin_files metadata table that exposes registered Puffin statistics files from Iceberg table metadata.

The table reads only Table#statisticsFiles() and does not open Puffin files, read Puffin footers, or parse blob payload bytes.

The new metadata table returns one row per registered statistics file with file-level summary information:

snapshot_id
statistics_path
file_size_in_bytes
file_footer_size_in_bytes
blob_count
blob_types
field_ids
field_names

Example Spark SQL output:

SELECT * FROM catalog.db.table..puffin_files;
snapshot_id statistics_path file_size_in_bytes file_footer_size_in_bytes blob_count blob_types field_ids field_names
xxxxxxxxxx .../xxxxxx....stats 617 523 2 ["apache-datasketches-theta-v1"] [1,2] ["id","data"]

Motivation

Iceberg tables can register Puffin statistics files in table metadata, but there is currently no metadata table that makes those registered statistics files easy to inspect through SQL.

Exposing this information through a metadata table makes it easier to debug and observe Puffin-backed table statistics, such as NDV statistics written by compute_table_stats, without requiring users to inspect metadata JSON manually.

@github-actions github-actions Bot added the core label Jul 13, 2026
@yangshangqing95 yangshangqing95 force-pushed the feat/puffin-metadata-tables branch from 9d29903 to 7e27ad9 Compare July 13, 2026 20:52
@yangshangqing95 yangshangqing95 force-pushed the feat/puffin-metadata-tables branch from 7e27ad9 to 928a796 Compare July 13, 2026 21:07
Comment on lines +946 to +953
required(1, "snapshot_id", Types.LongType.get()),
required(2, "statistics_path", Types.StringType.get()),
required(3, "file_size_in_bytes", Types.LongType.get()),
required(4, "file_footer_size_in_bytes", Types.LongType.get()),
required(5, "blob_count", Types.IntegerType.get()),
optional(6, "blob_types", Types.ListType.ofRequired(7, Types.StringType.get())),
optional(8, "field_ids", Types.ListType.ofRequired(9, Types.IntegerType.get())),
optional(10, "field_names", Types.ListType.ofOptional(11, Types.StringType.get())))

@ebyhr ebyhr Jul 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puffin spec currently supports two blob types apache-datasketches-theta-v1 & deletion-vector-v1: https://iceberg.apache.org/puffin-spec/#blob-types Exposing NDV-specific columns is weird to me. We should rename the metadata table, or change these columns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants