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 07:50:35 UTC

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

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



##########
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:
       Ah, nice catch. We cannot just return an empty row in `EmptyHashedRelation.keys()`?
   ```
   case object EmptyHashedRelation extends HashedRelation {
     ...
     override def keys(): Iterator[InternalRow] = {
       Iterator.empty[InternalRow]
     }
   ```




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