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

refactor(rust): Lower arbitrary expressions in the new streaming engine #18315

Merged
merged 16 commits into from
Aug 23, 2024

Conversation

orlp
Copy link
Collaborator

@orlp orlp commented Aug 22, 2024

Most non-elementwise expressions still fall back to the in-memory-map, but at least the groundwork is laid for lowering more and more expressions to the streaming engine over time.

Known bug: common subexpression elimination does not work for the streaming engine in general.

An example:

df.lazy().select(
    gt_avg = pl.col.x.filter(pl.col.x > pl.col.x.mean()).sum(),
    mae = (pl.col.x - pl.col.y).abs().mean()
)

out

@github-actions github-actions bot added internal An internal refactor or improvement rust Related to Rust Polars labels Aug 22, 2024
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 1.26183% with 313 lines in your changes missing coverage. Please review.

Project coverage is 80.24%. Comparing base (a601ccf) to head (791762b).
Report is 21 commits behind head on main.

Files Patch % Lines
...ates/polars-stream/src/physical_plan/lower_expr.rs 0.00% 255 Missing ⚠️
crates/polars-core/src/schema.rs 0.00% 18 Missing ⚠️
crates/polars-stream/src/graph.rs 0.00% 14 Missing ⚠️
crates/polars-stream/src/nodes/multiplexer.rs 0.00% 9 Missing ⚠️
crates/polars-plan/src/plans/options.rs 0.00% 6 Missing ⚠️
crates/polars-stream/src/execute.rs 0.00% 5 Missing ⚠️
crates/polars-stream/src/physical_plan/lower_ir.rs 0.00% 3 Missing ⚠️
crates/polars-stream/src/expression.rs 0.00% 2 Missing ⚠️
crates/polars-stream/src/skeleton.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #18315      +/-   ##
==========================================
- Coverage   80.35%   80.24%   -0.11%     
==========================================
  Files        1501     1502       +1     
  Lines      199236   199531     +295     
  Branches     2837     2837              
==========================================
+ Hits       160087   160105      +18     
- Misses      38623    38900     +277     
  Partials      526      526              

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

@ritchie46
Copy link
Member

Looking an awe at the complexity involved into a seemingly "simple" query. 😄

@ritchie46 ritchie46 merged commit fea6b02 into pola-rs:main Aug 23, 2024
24 checks passed
@c-peters c-peters added the accepted Ready for implementation label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation internal An internal refactor or improvement rust Related to Rust Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants