xzj7019 commented on code in PR #40654:
URL: https://github.com/apache/doris/pull/40654#discussion_r1753867317


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/stats/JoinEstimation.java:
##########
@@ -177,14 +181,27 @@ private static double 
computeSelectivityForBuildSideWhenColStatsUnknown(Statisti
             if (cond instanceof EqualTo) {
                 EqualTo equal = (EqualTo) cond;
                 if (equal.left() instanceof Slot && equal.right() instanceof 
Slot) {
-                    ColumnStatistic buildColStats = 
buildStats.findColumnStatistics(equal.left());
-                    if (buildColStats == null) {
-                        buildColStats = 
buildStats.findColumnStatistics(equal.right());
+                    Slot buildSideSlot = null;
+                    if (buildStats.findColumnStatistics(equal.left()) != null) 
{
+                        buildSideSlot = (Slot) equal.left();
+                    } else if (buildStats.findColumnStatistics(equal.right()) 
!= null) {
+                        buildSideSlot = (Slot) equal.right();
                     }
-                    if (buildColStats != null) {
-                        double buildSel = Math.min(buildStats.getRowCount() / 
buildColStats.count, 1.0);
-                        buildSel = Math.max(buildSel, 
UNKNOWN_COL_STATS_FILTER_SEL_LOWER_BOUND);
-                        sel = Math.min(sel, buildSel);
+                    // the processing is mainly for olap table since external 
table rarely has column level statistics

Review Comment:
   yes, i will think out a todo solution to resolve external table problem



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