Add Apache Iceberg format support#8148
Open
frankliee wants to merge 1 commit intohuggingface:mainfrom
Open
Conversation
lhoestq
reviewed
Apr 24, 2026
Member
lhoestq
left a comment
There was a problem hiding this comment.
Awesome ! I just have one comment:
| splits.append( | ||
| datasets.SplitGenerator( | ||
| name=split_name, | ||
| gen_kwargs={"scan": scan}, |
Member
There was a problem hiding this comment.
Do you think we can have a list here instead ? This would enable parallel processing/streaming
e.g. one scan object per file maybe
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Apache Iceberg format support
Motivation
Apache Iceberg is the most widely adopted open table format for data lakes, supported by Databricks,
Snowflake, AWS Glue, Dremio, and others. A large amount of ML training data lives in Iceberg tables.
Currently, users must manually export Iceberg data to Parquet before loading it into HuggingFace Datasets —
this PR removes that friction.
fix this (#7863)
Usage
Users pass a pre-configured pyiceberg Catalog object and a table identifier:
from pyiceberg.catalog.sql import SqlCatalog
from datasets import load_dataset
catalog = SqlCatalog("my_catalog", uri="sqlite:///catalog.db", warehouse="/tmp/warehouse")
Basic loading
ds = load_dataset("iceberg", catalog=catalog, table="db.my_table")
Column selection + row filtering (predicate pushdown)
ds = load_dataset("iceberg", catalog=catalog, table="db.my_table",
columns=["text", "label"],
filters=[("label", ">", 0)])
Multiple splits from different tables
ds = load_dataset("iceberg", catalog=catalog,
table={"train": "db.train", "test": "db.test"})
Time travel via snapshot_id
ds = load_dataset("iceberg", catalog=catalog, table="db.my_table",
snapshot_id=7051729674881785648)
Streaming
ds = load_dataset("iceberg", catalog=catalog, table="db.my_table", streaming=True)
Works with any pyiceberg-supported catalog backend (REST, Hive, Glue, SQL, etc.) — the builder is agnostic
to how the catalog is configured.
Design decisions
backends (REST, Hive, Glue, SQL each have different auth/connection params). Rather than re-implementing a
"catalog factory" inside the builder, users bring their own catalog — similar to how the sql builder accepts
an existing SQLAlchemy connection. This keeps the builder simple and forward-compatible with new catalog
types.
addressed via catalog + table identifier, not file extensions. Users must specify "iceberg" explicitly as
the path argument.
pools, etc.) are not picklable by dill. The override replaces the catalog with a stable string
representation ("{ClassName}_{name}") before hashing.
reading data files.