Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster parquet streaming + filters with predicate pushdown #7309

Merged
merged 2 commits into from
Dec 7, 2024

Conversation

lhoestq
Copy link
Member

@lhoestq lhoestq commented Dec 6, 2024

ParquetFragment.to_batches uses a buffered stream to read parquet data, which makes streaming faster (x2 on my laptop).

I also added the filters config parameter to support filtering with predicate pushdown, e.g.

from datasets import load_dataset

filters = [('problem_source', '==', 'math')]
ds = load_dataset("nvidia/OpenMathInstruct-2", streaming=True, filters=filters)
first_example = next(iter(ds["train"]))
print(first_example["problem_source"])
# 'math'

cc @allisonwang-db this is a nice plus for usage in spark

@HuggingFaceDocBuilderDev

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.

@lhoestq lhoestq merged commit 661d7ba into main Dec 7, 2024
15 checks passed
@lhoestq lhoestq deleted the faster-parquet-streaming-and-filters branch December 7, 2024 23:32
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.

2 participants