xudong963 commented on code in PR #24956:
URL: https://github.com/apache/datafusion/pull/24956#discussion_r3942899931


##########
datafusion/physical-plan/src/joins/piecewise_merge_join/classic_join.rs:
##########
@@ -336,6 +340,7 @@ impl ClassicPWMJStream {
         let buffered_data = 
Arc::clone(&self.buffered_side.try_as_ready()?.buffered_data);
         let buffered_batch = buffered_data.batch();
 
+        let join_timer = self.join_metrics.join_time.timer();

Review Comment:
   ditto



##########
datafusion/physical-plan/src/joins/piecewise_merge_join/existence_join.rs:
##########
@@ -241,12 +241,19 @@ impl ExistencePWMJStream {
                 self.join_metrics.input_batches.add(1);
                 self.join_metrics.input_rows.add(batch.num_rows());
 
-                // Only the batch's extreme key is ever compared against the 
buffered side,
-                // so reduce the batch to that one key.
-                let stream_values =
-                    extreme_key(&stream_values, self.sort_option.descending)?;
-
-                self.mark_matched_buffered_rows(&stream_values)?;
+                // An empty batch has no extreme key to compare, so it can 
neither match
+                // nor miss -- counting it either way would understate the 
real hit rate.
+                if batch.num_rows() > 0 {
+                    let join_time = self.join_metrics.join_time.clone();

Review Comment:
   ditto



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