AngersZhuuuu commented on a change in pull request #29692:
URL: https://github.com/apache/spark/pull/29692#discussion_r486138057



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeSkewedJoin.scala
##########
@@ -248,6 +249,74 @@ case class OptimizeSkewedJoin(conf: SQLConf) extends 
Rule[SparkPlan] {
       } else {
         smj
       }
+
+    case bnl @ BroadcastNestedLoopJoinExec(leftChild, rightChild, buildSide, 
joinType, _, _) =>
+      def resolveBroadcastNLJoinSkew(
+          stream: ShuffleStageInfo,
+          joinType: JoinType,
+          buildSide: BuildSide): SparkPlan = {
+        val streamMedSize = medianSize(stream.mapStats)
+        val numPartitions = stream.partitionsWithSizes.length
+        logDebug(
+          s"""
+             |Optimizing skewed join.
+             |Build Side:
+             |${buildSide}
+             |Stream side partitions size info:
+             |${getSizeInfo(streamMedSize, stream.mapStats.bytesByPartitionId)}
+        """.stripMargin)
+        val canSplitStream = canSplitLeftSide(joinType)

Review comment:
       > Is this really correct? How about the case: `BuildLeft` and 
right-outer?
   
   Sorry, a mistake, we should remove this condition since for 
BroadcastNestedLoopJoin, we don't need to care which kind join type.




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



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

Reply via email to