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

feat: support block gzip for streams #9175

Merged
merged 3 commits into from
Feb 14, 2024

Conversation

tshauck
Copy link
Contributor

@tshauck tshauck commented Feb 9, 2024

Which issue does this PR close?

Closes #9156

Rationale for this change

Updates the stream gzip decoding to check for multiple members within a file.

What changes are included in this PR?

Doesn't update the Read decoder because it already supports multiple members in a file.

Are these changes tested?

The gzip decoding still seems to work, and I checked a manually bgzipped file, but I'm not sure if this code path is tested already.

Are there any user-facing changes?

No

@github-actions github-actions bot added the core Core DataFusion crate label Feb 9, 2024
@tshauck tshauck mentioned this pull request Feb 9, 2024
@tshauck tshauck marked this pull request as ready for review February 9, 2024 05:48
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @tshauck -- this code looks great to me.

I do think this PR needs a test otherwise we could potentially end up breaking this feature by accident

here some the existing coverage

https://github.com/search?q=repo%3Aapache%2Farrow-datafusion%20aggregate_test_100.csv.gz&type=code

Which I think is referencing this file https://github.com/apache/arrow-testing/blob/master/data/csv/aggregate_test_100.csv.gz

Perhaps you can check in a small .bgzip'd file in https://github.com/apache/arrow-datafusion/tree/main/datafusion/core/tests/data and then add a small test to https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/test_files/csv_files.slt ?

@tshauck
Copy link
Contributor Author

tshauck commented Feb 10, 2024

Thanks @alamb -- certainly down to add a test. Before I go the route you mentioned, I wanted to ask if you knew that would follow the stream decoding path? Looking at https://github.com/apache/arrow-datafusion/blob/ae882356171513c9d6c22b3bd966898fb4e8cac0/datafusion/core/src/datasource/physical_plan/csv.rs#L393-L441 in the CsvOpener, I think local files would result in .convert_read being called and not .convert_stream which is what is modified in this PR? Is that right?

If not I'll code that up, otherwise perhaps adding a specific unittest that calls .convert_stream or maybe there's a way to force .convert_stream to be called from the slt-based tests? Thanks!

@alamb
Copy link
Contributor

alamb commented Feb 11, 2024

If not I'll code that up, otherwise perhaps adding a specific unittest that calls .convert_stream or maybe there's a way to force .convert_stream to be called from the slt-based tests? Thanks!

I think a specific unit test for convert stream would be great and easiest (and you can probably just generate some data directly)

@tshauck
Copy link
Contributor Author

tshauck commented Feb 13, 2024

I think this is ready for review @alamb.

Happy to take another approach testing, but in 4e009e1 I added the test which creates a byte stream from a hardcoded vector.

@tshauck tshauck requested a review from alamb February 13, 2024 22:41
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks good to me -- thank you @tshauck

@tshauck
Copy link
Contributor Author

tshauck commented Feb 14, 2024

Thanks!

@alamb alamb merged commit 0c46d7f into apache:main Feb 14, 2024
23 checks passed
@tshauck tshauck deleted the add-multiple-to-streaming-gzip branch February 14, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple_members on compression decoders?
2 participants