morrySnow commented on code in PR #40349:
URL: https://github.com/apache/doris/pull/40349#discussion_r1755128052


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java:
##########
@@ -288,6 +296,18 @@ private Plan planWithoutLock(
         return physicalPlan;
     }
 
+    private List<LogicalOlapScan> getAllOlapScans(Plan plan) {

Review Comment:
   could replace by `plan.collect(LogicalOlapScan.class::isInstance)`



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/StatsCalculator.java:
##########
@@ -205,6 +210,23 @@ public Map<String, ColumnStatistic> 
getTotalColumnStatisticMap() {
         return totalColumnStatisticMap;
     }
 
+    /**
+     * disable join reorder if any table row count is not available.
+     */
+    public static void disableJoinReorderIfTableRowCountNotAvailable(
+            List<LogicalOlapScan> scans, CascadesContext context) {
+        StatsCalculator calculator = new StatsCalculator(context);
+        for (LogicalOlapScan scan : scans) {
+            double rowCount = calculator.getOlapTableRowCount(scan);
+            if (rowCount == -1 && ConnectContext.get() != null) {

Review Comment:
   add comment here to explain magic number `-1`



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to