This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new af1a5d00146 branch-3.0: [opt](nereids) set column stats unkown by
default when derive Not expressoin #48864 (#49023)
af1a5d00146 is described below
commit af1a5d00146fb751ed0a61e64b08ec80b3b0d4c6
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Apr 22 10:41:51 2025 +0800
branch-3.0: [opt](nereids) set column stats unkown by default when derive
Not expressoin #48864 (#49023)
Cherry-picked from #48864
Co-authored-by: minghong <[email protected]>
---
.../org/apache/doris/nereids/stats/FilterEstimation.java | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java
index e050ae9fe0f..feb7690fa35 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/stats/FilterEstimation.java
@@ -502,14 +502,7 @@ public class FilterEstimation extends
ExpressionVisitor<Statistics, EstimationCo
// 4. not A like XXX
// 5. not array_contains([xx, xx], xx)
colBuilder.setNumNulls(0);
- Preconditions.checkArgument(
- child instanceof EqualPredicate
- || child instanceof InPredicate
- || child instanceof IsNull
- || child instanceof Like
- || child instanceof Match
- || child instanceof Function,
- "Not-predicate meet unexpected child: %s",
child.toSql());
+
if (child instanceof Like) {
rowCount = context.statistics.getRowCount() -
childStats.getRowCount();
colBuilder.setNdv(Math.max(1.0, originColStats.ndv -
childColStats.ndv));
@@ -534,6 +527,9 @@ public class FilterEstimation extends
ExpressionVisitor<Statistics, EstimationCo
} else if (child instanceof Match) {
rowCount = context.statistics.getRowCount() -
childStats.getRowCount();
colBuilder.setNdv(Math.max(1.0, originColStats.ndv -
childColStats.ndv));
+ } else {
+ rowCount = context.statistics.getRowCount() -
childStats.getRowCount();
+ colBuilder.setIsUnknown(true);
}
if (not.child().getInputSlots().size() == 1 && !(child
instanceof IsNull)) {
// only consider the single column numNull, otherwise,
ignore
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]