dilipbiswal commented on a change in pull request #23750: [SPARK-19712][SQL] 
Pushing Left Semi and Left Anti joins through Project, Aggregate, Window, Union 
etc.
URL: https://github.com/apache/spark/pull/23750#discussion_r258252820
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
 ##########
 @@ -345,10 +345,10 @@ class SQLMetricsSuite extends SparkFunSuite with 
SQLMetricsTestUtils with Shared
     val df1 = Seq((1, "1"), (2, "2")).toDF("key", "value")
     val df2 = Seq((1, "1"), (2, "2"), (3, "3"), (4, "4")).toDF("key2", "value")
     // Assume the execution plan is
-    // ... -> BroadcastHashJoin(nodeId = 0)
+    // ... -> BroadcastHashJoin(nodeId = 1)
     val df = df1.join(broadcast(df2), $"key" === $"key2", "leftsemi")
     testSparkPlanMetrics(df, 2, Map(
-      0L -> (("BroadcastHashJoin", Map(
+      1L -> (("BroadcastHashJoin", Map(
 
 Review comment:
   @cloud-fan In this case, we pushdown the leftsemi join below project.
   plan before:
   ```
   == Optimized Logical Plan ==
   Join LeftSemi, (key#247 = key2#258), rightHint=(broadcast)
   :- Project [_1#242 AS key#247, _2#243 AS value#248]
   :  +- LocalRelation [_1#242, _2#243]
   +- Project [_1#253 AS key2#258]
      +- LocalRelation [_1#253, _2#254]
   
   ```
   plan after:
   ```
   == Optimized Logical Plan ==
   Project [_1#242 AS key#247, _2#243 AS value#248]
   +- Join LeftSemi, (_1#242 = key2#258), rightHint=(broadcast)
      :- LocalRelation [_1#242, _2#243]
      +- Project [_1#253 AS key2#258]
         +- LocalRelation [_1#253, _2#254]
   
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to