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

Changes in how parquet is read #766

Merged
merged 3 commits into from
Oct 15, 2024
Merged

Changes in how parquet is read #766

merged 3 commits into from
Oct 15, 2024

Conversation

nikil-ravi
Copy link
Contributor

@nikil-ravi nikil-ravi commented Oct 15, 2024

Closes #763 and addresses David's comments in #764

@nikil-ravi nikil-ravi requested review from dlwh and percyliang October 15, 2024 09:05
@nikil-ravi nikil-ravi marked this pull request as ready for review October 15, 2024 09:09
Copy link
Member

@dlwh dlwh left a comment

Choose a reason for hiding this comment

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

lgtm modulo comments!


# read from the starting row group onwards
for rg_idx in range(row_group_index, parquet_file.num_row_groups):
table = parquet_file.read_row_group(rg_idx)
Copy link
Member

@dlwh dlwh Oct 15, 2024

Choose a reason for hiding this comment

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

Now I’m concerned this is a disk seek but probably not worth worrying about

raise ValueError(f"Unknown format {format}")
case ".parquet":
with fsspec.open(url, "rb", compression=compression) as f:
parquet_file = pq.ParquetFile(f)
Copy link
Member

Choose a reason for hiding this comment

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

the logic in this block is complex enough and duplicated enough i'd prefer if you extracted a method.

@dlwh dlwh merged commit 877ca7e into main Oct 15, 2024
7 of 8 checks passed
@dlwh dlwh deleted the nikil/parquet branch October 15, 2024 19:50
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 loading parquet files in addition to jsonl.gz
2 participants