ulysses-you commented on a change in pull request #32550:
URL: https://github.com/apache/spark/pull/32550#discussion_r634116193



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/joins.scala
##########
@@ -255,12 +255,28 @@ trait JoinSelectionHelper {
     val buildLeft = if (hintOnly) {
       hintToShuffleHashJoinLeft(hint)
     } else {
-      canBuildLocalHashMapBySize(left, conf) && muchSmaller(left, right)
+      if (hintToPreferShuffleHashJoinLeft(hint)) {

Review comment:
       Yeah,  we have already chose a smaller one since the `LogicalQueryStage` 
has override the `computeStats`. And see the code in `joins.getBuildSide`:
   ```
   private def getBuildSide(
         canBuildLeft: Boolean,
         canBuildRight: Boolean,
         left: LogicalPlan,
         right: LogicalPlan): Option[BuildSide] = {
       if (canBuildLeft && canBuildRight) {
         // returns the smaller side base on its estimated physical size, if we 
want to build the
         // both sides.
         Some(getSmallerSide(left, right))
       } else if (canBuildLeft) {
         Some(BuildLeft)
       } else if (canBuildRight) {
         Some(BuildRight)
       } else {
         None
       }
     }
   ```




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