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/09/23 02:54:53 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #34051: [SPARK-36809][SQL] Remove broadcast for InSubqueryExec used in DPP

HyukjinKwon commented on a change in pull request #34051:
URL: https://github.com/apache/spark/pull/34051#discussion_r714438751



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/subquery.scala
##########
@@ -130,14 +131,17 @@ case class InSubqueryExec(
     } else {
       rows.map(_.get(0, child.dataType))
     }
-    resultBroadcast = plan.session.sparkContext.broadcast(result)
+    if (needBroadcast) {
+      resultBroadcast = plan.session.sparkContext.broadcast(result)
+    }
   }
 
-  def values(): Option[Array[Any]] = Option(resultBroadcast).map(_.value)
+  // This is used only by DPP where we don't need broadcast the result.
+  def values(): Option[Array[Any]] = Option(result)
 
   private def prepareResult(): Unit = {

Review comment:
       maybe just adding an assert for sanity check would be fine?




-- 
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: reviews-unsubscribe@spark.apache.org

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