Dandandan commented on a change in pull request #9036:
URL: https://github.com/apache/arrow/pull/9036#discussion_r549556756



##########
File path: rust/datafusion/src/physical_plan/hash_join.rs
##########
@@ -531,14 +561,45 @@ impl Stream for HashJoinStream {
         self.right
             .poll_next_unpin(cx)
             .map(|maybe_batch| match maybe_batch {
-                Some(Ok(batch)) => Some(build_batch(
-                    &batch,
-                    &self.left_data,
-                    &self.on_right,
-                    &self.join_type,
-                    &self.schema,
-                )),
-                other => other,
+                Some(Ok(batch)) => {
+                    let start = Instant::now();
+                    let capacity = if self.num_output_batches == 0 {

Review comment:
       In https://github.com/apache/arrow/pull/9032 it was benchmarked to be a 
bit faster currently to initialize with capacity 0 than to use the correct 
capacity upfront. I think that is more something curious and hopefully will 
change, but that might be the case here too? What is the performance if we 
initialize with 0 everywhere?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to