Skip to content

feat: Add per partition sort and finish callback to sinks#22789

Merged
coastalwhite merged 13 commits intopola-rs:mainfrom
coastalwhite:feat/sink-hooks
May 23, 2025
Merged

feat: Add per partition sort and finish callback to sinks#22789
coastalwhite merged 13 commits intopola-rs:mainfrom
coastalwhite:feat/sink-hooks

Conversation

@coastalwhite
Copy link
Copy Markdown
Collaborator

@coastalwhite coastalwhite commented May 16, 2025

This adds 2 items to partition sinks

  • per_partition_sort_by which sorts a partition before writing by certain expressions
  • finish_callback which gets called with information about all the written files in the partition

These are needed for better Iceberg support.

@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 May 16, 2025
@coastalwhite coastalwhite marked this pull request as draft May 16, 2025 15:45
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2025

Codecov Report

Attention: Patch coverage is 72.63158% with 130 lines in your changes missing coverage. Please review.

Project coverage is 80.69%. Comparing base (622d792) to head (180d7c2).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...lars-stream/src/nodes/io_sinks/partition/parted.rs 0.00% 45 Missing ⚠️
crates/polars-plan/src/dsl/options/sink.rs 27.11% 43 Missing ⚠️
crates/polars-plan/src/plans/conversion/mod.rs 0.00% 10 Missing ⚠️
py-polars/polars/io/partition.py 69.23% 6 Missing and 2 partials ⚠️
...lars-stream/src/nodes/io_sinks/partition/by_key.rs 78.78% 7 Missing ⚠️
crates/polars-python/src/lazyframe/sink.rs 77.77% 6 Missing ⚠️
crates/polars-stream/src/nodes/io_sinks/metrics.rs 94.00% 6 Missing ⚠️
.../polars-stream/src/nodes/io_sinks/partition/mod.rs 93.18% 3 Missing ⚠️
...rs-stream/src/nodes/io_sinks/partition/max_size.rs 97.91% 1 Missing ⚠️
crates/polars-stream/src/physical_plan/to_graph.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #22789    +/-   ##
========================================
  Coverage   80.69%   80.69%            
========================================
  Files        1671     1672     +1     
  Lines      221440   221883   +443     
  Branches     2791     2798     +7     
========================================
+ Hits       178682   179051   +369     
- Misses      42093    42165    +72     
- Partials      665      667     +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coastalwhite coastalwhite changed the title feat: Add sink hooks feat: Add per partition sort and finish callback to sinks May 21, 2025
@coastalwhite coastalwhite marked this pull request as ready for review May 23, 2025 14:12
@coastalwhite coastalwhite merged commit 5993d95 into pola-rs:main May 23, 2025
28 checks passed
@coastalwhite coastalwhite deleted the feat/sink-hooks branch May 23, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant