EmmyMiao87 commented on a change in pull request #8393:
URL: https://github.com/apache/incubator-doris/pull/8393#discussion_r826872007



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
##########
@@ -377,6 +377,22 @@ private PlanFragment createHashJoinFragment(HashJoinNode 
node, PlanFragment righ
             node.setChild(0, leftChildFragment.getPlanRoot());
             connectChildFragment(node, 1, leftChildFragment, 
rightChildFragment);
             leftChildFragment.setPlanRoot(node);
+
+            // Shared hash table not support right join.

Review comment:
       If it's broadcast then you can use shared table if not you can't.
   An error may occur if only judged by the join type. 
   For example, although it is an inner join, but the distributed method is 
shuffle, a shared table cannot be performed.

##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/PlanFragment.java
##########
@@ -136,6 +136,10 @@
     // has colocate plan node
     private boolean hasColocatePlanNode = false;
 
+    // Shared hash table id in the fragment.if it's empty means shared hash 
table feature is close.

Review comment:
       ```suggestion
       // Shared hash table id in the fragment. If it's empty means no hash 
table could be shared.
   ```

##########
File path: fe/fe-core/src/main/java/org/apache/doris/planner/HashJoinNode.java
##########
@@ -75,6 +75,10 @@
     private boolean isColocate = false; //the flag for colocate join
     private String colocateReason = ""; // if can not do colocate join, set 
reason here
     private boolean isBucketShuffle = false; // the flag for bucket shuffle 
join
+    // The instances of hashjoin which DistributionMode is 
HashJoinNode.DistributionMode.BROADCAST
+    // share the same hash table within the one process.
+    private HashTableId sharedHashTableId = new HashTableId(-1); // shared 
hash table id.
+    private boolean isSharedHashTableLeader = false;

Review comment:
       Unused code ~

##########
File path: fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
##########
@@ -121,6 +121,7 @@
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
+import org.apache.doris.planner.HashTableId;

Review comment:
       Pay attention to the order of import ~

##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/planner/DistributedPlanner.java
##########
@@ -377,6 +377,22 @@ private PlanFragment createHashJoinFragment(HashJoinNode 
node, PlanFragment righ
             node.setChild(0, leftChildFragment.getPlanRoot());
             connectChildFragment(node, 1, leftChildFragment, 
rightChildFragment);
             leftChildFragment.setPlanRoot(node);
+
+            // Shared hash table not support right join.
+            if 
(ConnectContext.get().getSessionVariable().isEnableSharedHashTable() &&

Review comment:
       Also, please check the result of 'ConnectContext.get()'. It maybe null 
sometimes




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