mcdull-zhang commented on code in PR #43938:
URL: https://github.com/apache/spark/pull/43938#discussion_r1403085112


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashJoin.scala:
##########
@@ -138,9 +138,8 @@ trait HashJoin extends JoinCodegenSupport {
     UnsafeProjection.create(streamedBoundKeys)
 
   @transient protected[this] lazy val boundCondition = if 
(condition.isDefined) {
-    if (joinType == FullOuter && buildSide == BuildLeft) {
-      // Put join left side before right side. This is to be consistent with
-      // `ShuffledHashJoinExec.fullOuterJoin`.
+    if ((joinType == FullOuter || joinType == LeftOuter) && buildSide == 
BuildLeft) {
+      // Put join left side before right side. This is to be consistent with 
ShuffledHashJoinExec.

Review Comment:
   HashJoin.scala
   ```scala
   override def output: Seq[Attribute] = {
       joinType match {
         case _: InnerLike =>
           left.output ++ right.output
         case LeftOuter =>
           left.output ++ right.output.map(_.withNullability(true))
         case RightOuter =>
           left.output.map(_.withNullability(true)) ++ right.output
         case j: ExistenceJoin =>
           left.output :+ j.exists
         case LeftExistence(_) =>
           left.output
         case x =>
           throw new IllegalArgumentException(s"HashJoin should not take $x as 
the JoinType")
       }
     }
   ```
   
   
   ShuffledJoin.scala
   ```scala
   override def output: Seq[Attribute] = {
       joinType match {
         case _: InnerLike =>
           left.output ++ right.output
         case LeftOuter =>
           left.output ++ right.output.map(_.withNullability(true))
         case RightOuter =>
           left.output.map(_.withNullability(true)) ++ right.output
         case FullOuter =>
           (left.output ++ right.output).map(_.withNullability(true))
         case j: ExistenceJoin =>
           left.output :+ j.exists
         case LeftExistence(_) =>
           left.output
         case x =>
           throw new IllegalArgumentException(
             s"${getClass.getSimpleName} not take $x as the JoinType")
       }
     }
   ```
   
   
   @cloud-fan  Output determines that we cannot simply put streaming side left 
and build side right.  
   Am I understanding correctly?



-- 
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: [email protected]

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