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 2020/09/08 08:15:05 UTC

[GitHub] [spark] wzhfy commented on a change in pull request #29671: [SPARK-32817][SQL] DPP throws error when broadcast side is empty

wzhfy commented on a change in pull request #29671:
URL: https://github.com/apache/spark/pull/29671#discussion_r484734168



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/SubqueryBroadcastExec.scala
##########
@@ -75,17 +75,21 @@ case class SubqueryBroadcastExec(
         val beforeCollect = System.nanoTime()
 
         val broadcastRelation = child.executeBroadcast[HashedRelation]().value
-        val (iter, expr) = if (broadcastRelation.isInstanceOf[LongHashedRelation]) {
-          (broadcastRelation.keys(), HashJoin.extractKeyExprAt(buildKeys, index))
-        } else {
-          (broadcastRelation.keys(),
-            BoundReference(index, buildKeys(index).dataType, buildKeys(index).nullable))
+        val rows = broadcastRelation match {
+          case EmptyHashedRelation =>
+            Array.empty[InternalRow]

Review comment:
       I'm also surprised it throws an exception instead of returning an empty iterator. I'm not sure if there is any particular reason to do this. But I'll try to update as your suggestion and see if it works, thanks!




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