tustvold commented on code in PR #7250:
URL: https://github.com/apache/arrow-datafusion/pull/7250#discussion_r1291574292
##########
datafusion/core/src/physical_plan/sorts/sort.rs:
##########
@@ -847,29 +853,54 @@ impl ExecutionPlan for SortExec {
trace!("End SortExec's input.execute for partition: {}", partition);
- let mut sorter = ExternalSorter::new(
- partition,
- input.schema(),
- self.expr.clone(),
- context.session_config().batch_size(),
- self.fetch,
- execution_options.sort_spill_reservation_bytes,
- execution_options.sort_in_place_threshold_bytes,
- &self.metrics_set,
- context.runtime_env(),
- );
+ if let Some(fetch) = self.fetch.as_ref() {
Review Comment:
I wonder if there is some threshold at which the fetch is large enough that
sorting is the better approach, certainly if the fetch is large enough that we
need to spill
--
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]