You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/13 02:23:31 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31477: [SPARK-34369][SQL][WEBUI] Track number of pairs processed out of Join.

dongjoon-hyun commented on a change in pull request #31477:
URL: https://github.com/apache/spark/pull/31477#discussion_r575606176



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashJoin.scala
##########
@@ -137,10 +144,19 @@ trait HashJoin extends BaseJoinExec with CodegenSupport {
   protected def streamSideKeyGenerator(): UnsafeProjection =
     UnsafeProjection.create(streamedBoundKeys)
 
-  @transient protected[this] lazy val boundCondition = if (condition.isDefined) {
-    Predicate.create(condition.get, streamedPlan.output ++ buildPlan.output).eval _
-  } else {
-    (r: InternalRow) => true
+  private val numMatchedRows = longMetric("numMatchedRows")
+
+  @transient protected[this] lazy val boundCondition: InternalRow => Boolean =
+    if (condition.isDefined) {
+      (r: InternalRow) => {
+        numMatchedRows += 1
+        Predicate.create(condition.get, streamedPlan.output ++ buildPlan.output).eval(r)
+      }
+    } else {
+      (_: InternalRow) => {
+        numMatchedRows += 1
+        true
+      }
   }

Review comment:
       Indentation?




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org