cloud-fan commented on a change in pull request #29104:
URL: https://github.com/apache/spark/pull/29104#discussion_r460771904



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashedRelation.scala
##########
@@ -903,15 +926,65 @@ private[joins] object LongHashedRelation {
       if (!rowKey.isNullAt(0)) {
         val key = rowKey.getLong(0)
         map.append(key, unsafeRow)
+      } else if (isNullAware) {
+        return new EmptyHashedRelationWithAllNullKeys
       }
     }
     map.optimize()
     new LongHashedRelation(numFields, map)
   }
 }
 
+/**
+ * A special HashedRelation indicates it built from a empty 
input:Iterator[InternalRow].
+ */
+class EmptyHashedRelation extends HashedRelation with Externalizable {

Review comment:
       shall we have a common trait for these 2 to contain the fake 
implementation?




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