-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When running a query like select a from annotated_data_infinite2 order by b desc limit 10
, a SortPreservingMergeStream
is created that merge sorts the presorted partitions. During the initial sorting phase of the query, the query execution will continuously hit
return Poll::Pending; |
I believe this was introduced in f2a8b07. It's not clear to me why the self wake was added.
To Reproduce
- Add
print!("P"); stdout().flush();
just before the return at https://github.com/apache/datafusion/blob/main/datafusion/physical-plan/src/sorts/merge.rs#L236 - Run a sort on a large dataset with target partitions > 1 so that
SortPreservingMergeStream
is used. - Observe how often the
poll_next_inner
is hit
Expected behavior
- No busy-waiting during query execution
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working