Tim-53 commented on code in PR #18540:
URL: https://github.com/apache/datafusion/pull/18540#discussion_r2508459533


##########
datafusion/physical-optimizer/src/coalesce_batches.rs:
##########
@@ -72,11 +72,26 @@ impl PhysicalOptimizerRule for CoalesceBatches {
                         )
                     })
                     .unwrap_or(false);
+
             if wrap_in_coalesce {
                 Ok(Transformed::yes(Arc::new(CoalesceBatchesExec::new(
                     plan,
                     target_batch_size,
                 ))))
+            } else if let Some(async_exec) = 
plan_any.downcast_ref::<AsyncFuncExec>() {

Review Comment:
   I considered adding it at first, but I realized that inside `AsyncFuncExec`, 
the `CoalesceBatchesExec` is wrapped around the first child, whereas for the 
other operators it's wrapped around the entire plan.
   I'm not sure whether changing the order inside `AsyncFuncExec` to match the 
others would have any impact, so I kept it as is for now.
   I'll look into it further, but if anyone already has context on why it’s 
done this way, I’d appreciate any insights.



-- 
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]

Reply via email to