-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Optimize SortPreservingMergeStream
to avoid SortKeyCursor
sharing
#1624
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this change 👍
That being said I think it would be good to rename some things and update the corresponding comments to avoid future confusion. I also think it is possible to remove the Arc
but I could be missing something...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a great improvement to me 👍
Thanks again @yjshen |
Which issue does this PR close?
This PR is based on #1596 so please review that one first.Rationale for this change
In
SortPreservingMergeStream
,SortKeyCursor
shouldn't be shared betweenmin_heap
and output batch buffer. The current sharing leads to the use ofAtomicUsize
, which may harm performance.What changes are included in this PR?
RecordBatch
instead ofSortKeyCursor
for output batch buffering.cursor_finished
to make sure each input stream is pulled after a resume fromPending
.AtomicUsize
from SortKeyCursor.Are there any user-facing changes?
No.