rluvaton commented on PR #20482:
URL: https://github.com/apache/datafusion/pull/20482#issuecomment-3950350771

   > I think the `EmitReady { next_state: Box<SortMergeJoinState> }` adds a 
heap allocation on every group boundary. But looking at the current code, the 
only `next_state` ever used is `Init`. Could we add the completed-batch flush 
directly in the `scanning_finished()` branch?
   > 
   > ```rust
   > if self.buffered_data.scanning_finished() {
   >     self.buffered_data.scanning_reset();
   >     // Flush any completed batch before going to Init
   >     if !needs_deferred_filtering(...) {
   >         if self.joined_record_batches.joined_batches.has_completed_batch() 
{
   >             // return it
   >         }
   >     }
   >     self.state = SortMergeJoinState::Init;
   > }
   > ```
   
   this won't work (the tests are failing) probably because `JoinOutput` have 
`join_partial` function call before


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