feat: Add maintain_order parameter to merge_sorted#27263
Open
jonathanchang31 wants to merge 3 commits intopola-rs:mainfrom
Open
feat: Add maintain_order parameter to merge_sorted#27263jonathanchang31 wants to merge 3 commits intopola-rs:mainfrom
maintain_order parameter to merge_sorted#27263jonathanchang31 wants to merge 3 commits intopola-rs:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #27263 +/- ##
=======================================
Coverage 81.58% 81.59%
=======================================
Files 1820 1820
Lines 251036 251083 +47
Branches 3149 3149
=======================================
+ Hits 204808 204867 +59
+ Misses 45420 45408 -12
Partials 808 808 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #27114.
Adds a
maintain_order: boolparameter tomerge_sorted(). When set toTrue, the output is guaranteed to have left-biased ordering for equal keys: rows from the left frame always appear before rows from the right frame when their keys match.maintain_orderthrough the full stack: Python API → PyO3 bindings → DSL/IR plan → streaming engine → in-memory enginefind_mergeable()holds back right-side rows at chunk boundaries whose keys equal the left's maximum (usesgt_eqinstead ofgt), preventing right-side ties from being emitted before left-side ties arriving in later morselsFalsefor backward compatibilityTest plan
DataFrame.merge_sorted()API pathmerge_sortedtests pass with no regressionscargo check --features merge_sortedpasses