Skip to content

Commit

Permalink
[fix](Nereids) stats estimation of lessThan apache#28444
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly authored Dec 19, 2023
1 parent a104914 commit 372a2e2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ private Statistics estimateColumnLessThanColumn(Expression leftExpr, ColumnStati
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,8 @@ public double getDistinctValues() {
return distinctValues;
}

@Override
public String toString() {
return "(" + lowExpr + "," + highExpr + ")";
}
}

0 comments on commit 372a2e2

Please sign in to comment.