Skip to content

Commit 24aecee

Browse files
engleflymorningman
authored andcommitted
[fix](Nereids) stats estimation of lessThan #28444
1 parent 2121c97 commit 24aecee

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java

+4
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ private Statistics estimateColumnLessThanColumn(Expression leftExpr, ColumnStati
512512
context.addKeyIfSlot(rightExpr);
513513
return statistics;
514514
}
515+
if (leftRange.isInfinite() || rightRange.isInfinite()) {
516+
return context.statistics.withSel(DEFAULT_INEQUALITY_COEFFICIENT);
517+
}
518+
515519
double leftOverlapPercent = leftRange.overlapPercentWith(rightRange);
516520
// Left always greater than right
517521
if (leftOverlapPercent == 0) {

fe/fe-core/src/main/java/org/apache/doris/statistics/StatisticRange.java

+4
Original file line numberDiff line numberDiff line change
@@ -239,4 +239,8 @@ public double getDistinctValues() {
239239
return distinctValues;
240240
}
241241

242+
@Override
243+
public String toString() {
244+
return "(" + lowExpr + "," + highExpr + ")";
245+
}
242246
}

0 commit comments

Comments
 (0)