You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/08/21 11:13:23 UTC

[GitHub] [incubator-doris] wyb opened a new pull request #4424: Fix explicit broadcast join bug

wyb opened a new pull request #4424:
URL: https://github.com/apache/incubator-doris/pull/4424


   Use broadcast join when users specify explicitly `[BROADCAST]` in queries.


----------------------------------------------------------------
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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] kangkaisen commented on a change in pull request #4424: Fix explicit broadcast join bug

Posted by GitBox <gi...@apache.org>.
kangkaisen commented on a change in pull request #4424:
URL: https://github.com/apache/incubator-doris/pull/4424#discussion_r474634686



##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
##########
@@ -361,13 +361,17 @@ private PlanFragment createHashJoinFragment(HashJoinNode node, PlanFragment righ
         //   side to be partitioned for correctness)
         // - and the expected size of the hash tbl doesn't exceed perNodeMemLimit
         // we set partition join as default when broadcast join cost equals partition join cost
-        if (node.getJoinOp() != JoinOperator.RIGHT_OUTER_JOIN
-                && node.getJoinOp() != JoinOperator.FULL_OUTER_JOIN
-                && (perNodeMemLimit == 0 || Math.round(
-                (double) rhsDataSize * PlannerContext.HASH_TBL_SPACE_OVERHEAD) <= perNodeMemLimit)
-                && (node.getInnerRef().isBroadcastJoin() || (!node.getInnerRef().isPartitionJoin()
-                && isBroadcastCostSmaller(broadcastCost, partitionCost)))) {
-            doBroadcast = true;
+        if (node.getJoinOp() != JoinOperator.RIGHT_OUTER_JOIN && node.getJoinOp() != JoinOperator.FULL_OUTER_JOIN) {
+            if (node.getInnerRef().isBroadcastJoin()) {
+                // explicitly told
+                doBroadcast = true;
+            } else if ((perNodeMemLimit == 0 ||
+                        Math.round((double) rhsDataSize * PlannerContext.HASH_TBL_SPACE_OVERHEAD) <= perNodeMemLimit)
+                    && (!node.getInnerRef().isPartitionJoin() && isBroadcastCostSmaller(broadcastCost, partitionCost))) {

Review comment:
       Could move `node.getInnerRef().isPartitionJoin()` to first




----------------------------------------------------------------
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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman merged pull request #4424: Fix explicit broadcast join bug

Posted by GitBox <gi...@apache.org>.
morningman merged pull request #4424:
URL: https://github.com/apache/incubator-doris/pull/4424


   


----------------------------------------------------------------
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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] kangkaisen commented on a change in pull request #4424: Fix explicit broadcast join bug

Posted by GitBox <gi...@apache.org>.
kangkaisen commented on a change in pull request #4424:
URL: https://github.com/apache/incubator-doris/pull/4424#discussion_r474634489



##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
##########
@@ -361,13 +361,17 @@ private PlanFragment createHashJoinFragment(HashJoinNode node, PlanFragment righ
         //   side to be partitioned for correctness)
         // - and the expected size of the hash tbl doesn't exceed perNodeMemLimit
         // we set partition join as default when broadcast join cost equals partition join cost
-        if (node.getJoinOp() != JoinOperator.RIGHT_OUTER_JOIN
-                && node.getJoinOp() != JoinOperator.FULL_OUTER_JOIN
-                && (perNodeMemLimit == 0 || Math.round(
-                (double) rhsDataSize * PlannerContext.HASH_TBL_SPACE_OVERHEAD) <= perNodeMemLimit)
-                && (node.getInnerRef().isBroadcastJoin() || (!node.getInnerRef().isPartitionJoin()
-                && isBroadcastCostSmaller(broadcastCost, partitionCost)))) {
-            doBroadcast = true;
+        if (node.getJoinOp() != JoinOperator.RIGHT_OUTER_JOIN && node.getJoinOp() != JoinOperator.FULL_OUTER_JOIN) {
+            if (node.getInnerRef().isBroadcastJoin()) {
+                // explicitly told

Review comment:
       ```suggestion
                   // respect user join hint
   ```




----------------------------------------------------------------
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: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org