ozankabak commented on code in PR #12174:
URL: https://github.com/apache/datafusion/pull/12174#discussion_r1735089341
##########
datafusion/physical-plan/src/sorts/sort.rs:
##########
@@ -874,53 +892,67 @@ impl ExecutionPlan for SortExec {
trace!("End SortExec's input.execute for partition: {}", partition);
- if let Some(fetch) = self.fetch.as_ref() {
- let mut topk = TopK::try_new(
- partition,
- input.schema(),
- self.expr.clone(),
- *fetch,
- context.session_config().batch_size(),
- context.runtime_env(),
- &self.metrics_set,
- partition,
- )?;
-
- Ok(Box::pin(RecordBatchStreamAdapter::new(
- self.schema(),
- futures::stream::once(async move {
- while let Some(batch) = input.next().await {
- let batch = batch?;
- topk.insert_batch(batch)?;
- }
- topk.emit()
- })
- .try_flatten(),
- )))
- } else {
- 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(),
+ let sort_satisfied = self
Review Comment:
It is similar but not exactly the same (i.e. execution mode is derived from
`sort_satisfied` but AFAIK the reverse is not possible). I think @berkaysynnada
tried this but it didn't work
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]