Skip to content

feat: support history metadata table.#2463

Open
slfan1989 wants to merge 2 commits into
apache:mainfrom
slfan1989:iceberg-rust-2462
Open

feat: support history metadata table.#2463
slfan1989 wants to merge 2 commits into
apache:mainfrom
slfan1989:iceberg-rust-2462

Conversation

@slfan1989
Copy link
Copy Markdown
Contributor

@slfan1989 slfan1989 commented May 18, 2026

Which issue does this PR close?

What changes are included in this PR?

This PR adds support for the history metadata table.

Main changes:

  • Add HistoryTable under crates/iceberg/src/inspect/.
  • Add MetadataTableType::History.
  • Support parsing "history" as a metadata table type.
  • Expose table.inspect().history().
  • Wire the history metadata table into the DataFusion metadata table provider.
  • Support querying the table through DataFusion using:
SELECT * FROM my_table$history;

The history metadata table exposes the following columns:

Column Description
made_current_at Timestamp when the snapshot was made current
snapshot_id Snapshot ID from the table snapshot log
parent_id Parent snapshot ID, if available
is_current_ancestor Whether the snapshot is an ancestor of the current snapshot

Are these changes tested?

Yes.

This PR adds and updates tests for:

  • table.inspect().history().scan() schema and returned rows.
  • MetadataTableType::try_from("history").
  • DataFusion metadata table listing to include table$history.
  • DataFusion SQL query support for SELECT * FROM table$history.

@slfan1989
Copy link
Copy Markdown
Contributor Author

@kevinjqliu @CTTY Could you please help review this PR? Thank you very much!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support history metadata table

1 participant