tustvold commented on code in PR #5881:
URL: https://github.com/apache/arrow-datafusion/pull/5881#discussion_r1159006238
##########
datafusion/core/benches/sort.rs:
##########
@@ -210,58 +178,61 @@ impl SortBenchCase {
}
}
- /// runs the specified plan to completion, draining all input and
- /// panic'ing on error
- fn run(&self) {
- let plan = Arc::clone(&self.plan);
- let task_ctx = Arc::clone(&self.task_ctx);
+ fn sort_merge(partitions: &[Vec<RecordBatch>]) -> Self {
+ let runtime =
tokio::runtime::Builder::new_multi_thread().build().unwrap();
+ let session_ctx = SessionContext::new();
+ let task_ctx = session_ctx.task_ctx();
- assert_eq!(plan.output_partitioning().partition_count(), 1);
+ let schema = partitions[0][0].schema();
+ let sort = make_sort_exprs(schema.as_ref());
- self.runtime.block_on(async move {
- let mut stream = plan.execute(0, task_ctx).unwrap();
- while let Some(b) = stream.next().await {
- b.expect("unexpected execution error");
- }
- })
+ let exec = MemoryExec::try_new(partitions, schema, None).unwrap();
+ let exec =
+ SortExec::new_with_partitioning(sort.clone(), Arc::new(exec),
true, None);
+ let plan = Arc::new(SortPreservingMergeExec::new(sort,
Arc::new(exec)));
Review Comment:
Eventually yes, currently for single column cases it performs worse
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]