[fix](Nereids) stats estimation of lessThan #28444

This commit is contained in:
minghong
2023-12-19 15:45:03 +08:00
committed by GitHub
parent a104914880
commit 372a2e20f9
2 changed files with 8 additions and 0 deletions

View File

@ -512,6 +512,10 @@ public class FilterEstimation extends ExpressionVisitor<Statistics, EstimationCo
context.addKeyIfSlot(rightExpr);
return statistics;
}
if (leftRange.isInfinite() || rightRange.isInfinite()) {
return context.statistics.withSel(DEFAULT_INEQUALITY_COEFFICIENT);
}
double leftOverlapPercent = leftRange.overlapPercentWith(rightRange);
// Left always greater than right
if (leftOverlapPercent == 0) {

View File

@ -239,4 +239,8 @@ public class StatisticRange {
return distinctValues;
}
@Override
public String toString() {
return "(" + lowExpr + "," + highExpr + ")";
}
}