fix in stats estimation (#31684)

the valid in option should

! (op.min > expr.max or op.max < expr.min) 
=============> 
op.min <= expr.max and op.max >= expr.min
This commit is contained in:
谢健
2024-03-04 15:28:18 +08:00
committed by yiguolei
parent e2ebf9d566
commit 33c356e6d8

View File

@ -290,7 +290,7 @@ public class FilterEstimation extends ExpressionVisitor<Statistics, EstimationCo
if (option instanceof Literal) {
// remove the options which is out of compareExpr.range
if (compareExprStats.minValue <= optionStats.maxValue
&& optionStats.maxValue <= compareExprStats.maxValue) {
&& optionStats.minValue <= compareExprStats.maxValue) {
validInOptCount++;
LiteralExpr optionLiteralExpr = ((Literal) option).toLegacyLiteral();
if (maxOptionLiteral == null || optionLiteralExpr.compareTo(maxOptionLiteral) >= 0) {