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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org