danielhumanmod commented on code in PR #1380:
URL: 
https://github.com/apache/datafusion-ballista/pull/1380#discussion_r2710915797


##########
ballista/core/src/execution_plans/shuffle_reader.rs:
##########
@@ -197,11 +201,22 @@ impl ExecutionPlan for ShuffleReaderExec {
             prefer_flight,
         );
 
-        let result = RecordBatchStreamAdapter::new(
-            Arc::new(self.schema.as_ref().clone()),
+        let input_stream = Box::pin(RecordBatchStreamAdapter::new(
+            self.schema.clone(),
             response_receiver.try_flatten(),
-        );
-        Ok(Box::pin(result))
+        ));
+
+        Ok(Box::pin(CoalescedShuffleReaderStream {
+            schema: self.schema.clone(),
+            input: input_stream,
+            coalescer: LimitedBatchCoalescer::new(

Review Comment:
   > what is the reason using `LimitedBatchCoalescer` instead of 
`BatchCoalescer` as there is no fetch limit?
   > 
   > would there be a case where we can use limit 🤔?
   
   Regarding `LimitedBatchCoalescer`, I initially chose it because it offers 
better encapsulation for the stream state machine compared to the raw 
`BatchCoalescer`. Specifically, it manages the finished state and provides 
PushBatchStatus, which makes the poll_next implementation cleaner and safer, 
even without a limit.



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