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/04/01 02:57:22 UTC

[GitHub] [incubator-doris] wutiangan commented on a change in pull request #3188: fix join hints not work when need table reorder

wutiangan commented on a change in pull request #3188: fix join hints not work when need table reorder
URL: https://github.com/apache/incubator-doris/pull/3188#discussion_r401328148
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/analysis/SelectStmt.java
 ##########
 @@ -612,11 +611,14 @@ public void materializeRequiredSlots(Analyzer analyzer) throws AnalysisException
         }
     }
 
+    // When a join statement with a join hint, the decorated part should be reordered as a whole,
+    // rather than individually.
     protected void reorderTable(Analyzer analyzer) throws AnalysisException {
-        List<Pair<TableRef, Long>> candidates = Lists.newArrayList();
+        List<Pair<List<TableRef>, Long>> candidates = Lists.newArrayList();
 
-        // New pair of table ref and row count
-        for (TableRef tblRef : fromClause_) {
+        for (int i = 0; i < fromClause_.size(); ++i) {
+            List<TableRef> tableRefs = new ArrayList<>();
+            TableRef tblRef = fromClause_.get(i);
             if (tblRef.getJoinOp() != JoinOperator.INNER_JOIN) {
                 // Unsupported reorder outer join
 
 Review comment:
   How about cross join?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org