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: Implement predicate and projection pushdown for read_ndjson #17068

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

coastalwhite
Copy link
Collaborator

This PR adds predicate and projection pushdown in NDJson in a similar fashion as is done in CSV. This currently just filters after each chunk is deserialized, which is not perfectly efficient. It would probably be a good idea to do the projection during the into_series call and the predicate during the ...ChunkedBuilder append value.

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars labels Jun 19, 2024
This PR adds predicate and projection pushdown in NDJson in a similar fashion as is done in CSV. This currently just filters after each chunk is deserialized, which is not perfectly efficient. It would probably be a good idea to do the projection during the `into_series` call and the predicate during the `...ChunkedBuilder` append value.
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 86.84211% with 10 lines in your changes missing coverage. Please review.

Project coverage is 80.86%. Comparing base (4d15fd4) to head (4368044).
Report is 4 commits behind head on main.

Files Patch % Lines
crates/polars-io/src/utils.rs 46.15% 7 Missing ⚠️
crates/polars-io/src/ndjson/core.rs 94.11% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17068      +/-   ##
==========================================
- Coverage   80.89%   80.86%   -0.03%     
==========================================
  Files        1455     1455              
  Lines      190961   191086     +125     
  Branches     2723     2723              
==========================================
+ Hits       154473   154518      +45     
- Misses      35984    36064      +80     
  Partials      504      504              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ritchie46 ritchie46 left a comment

Choose a reason for hiding this comment

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

Thanks. I think that's fine for now. It isn't a super common file format, so we can further optimize later.

@ritchie46 ritchie46 merged commit 235ebee into pola-rs:main Jun 19, 2024
26 checks passed
Wouittone pushed a commit to Wouittone/polars that referenced this pull request Jun 22, 2024
@c-peters c-peters added the accepted Ready for implementation label Jun 24, 2024
@stinodego stinodego changed the title feat: predicate + projection pushdown in NDJson feat: Implement predicate and projection pushdown for read_ndjson Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants