This is an automated email from the ASF dual-hosted git repository.
924060929 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 1a3772ff041 [fix](expr) fix deep match expr utils duplicate walk
(#68362)
1a3772ff041 is described below
commit 1a3772ff041630444eab49b98eaccbc90fabbe8e
Author: feiniaofeiafei <[email protected]>
AuthorDate: Wed Sep 23 10:51:25 2026 +0800
[fix](expr) fix deep match expr utils duplicate walk (#68362)
### What problem does this PR solve?
Related PR: #32617
fix deep match expr utils duplicate walk
---
.../org/apache/doris/nereids/rules/rewrite/MergeAggregate.java | 2 +-
.../apache/doris/nereids/rules/rewrite/PushCountIntoUnionAll.java | 2 +-
.../main/java/org/apache/doris/nereids/util/AggregateUtils.java | 4 ++--
.../main/java/org/apache/doris/nereids/util/ExpressionUtils.java | 8 ++++----
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/MergeAggregate.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/MergeAggregate.java
index ca3bc69649d..c89ce4570ac 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/MergeAggregate.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/MergeAggregate.java
@@ -218,7 +218,7 @@ public class MergeAggregate implements RewriteRuleFactory {
return false;
}
// project cannot have expressions like a+1
- if (ExpressionUtils.deapAnyMatch(project.getProjects(),
+ if (ExpressionUtils.deepAnyMatch(project.getProjects(),
expr -> !(expr instanceof SlotReference) && !(expr instanceof
Alias))) {
return false;
}
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushCountIntoUnionAll.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushCountIntoUnionAll.java
index ddca8e479a3..b1fb62f5107 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushCountIntoUnionAll.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushCountIntoUnionAll.java
@@ -195,7 +195,7 @@ public class PushCountIntoUnionAll implements
RewriteRuleFactory {
private boolean hasUnsuportedAggFunc(LogicalAggregate aggregate) {
// only support count, not suport sum,min... and not support
count(distinct)
- return ExpressionUtils.deapAnyMatch(aggregate.getOutputExpressions(),
expr -> {
+ return ExpressionUtils.deepAnyMatch(aggregate.getOutputExpressions(),
expr -> {
if (expr instanceof AggregateFunction) {
if (!(expr instanceof Count)) {
return true;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/AggregateUtils.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/AggregateUtils.java
index 911d13f3c59..b16320beeaa 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/AggregateUtils.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/AggregateUtils.java
@@ -148,13 +148,13 @@ public class AggregateUtils {
}
public static boolean containsCountDistinctMultiExpr(LogicalAggregate<?
extends Plan> aggregate) {
- return ExpressionUtils.deapAnyMatch(aggregate.getOutputExpressions(),
expr ->
+ return ExpressionUtils.deepAnyMatch(aggregate.getOutputExpressions(),
expr ->
expr instanceof Count && ((Count) expr).isDistinct() &&
expr.arity() > 1);
}
/** e.g. Aggregation with avg(distinct a)(not support multiDistinct) or
count(distinct a,b) will return true*/
public static boolean
containsNotSupportMultiDistinctFunction(LogicalAggregate<? extends Plan>
aggregate) {
- return ExpressionUtils.deapAnyMatch(aggregate.getOutputExpressions(),
expr -> {
+ return ExpressionUtils.deepAnyMatch(aggregate.getOutputExpressions(),
expr -> {
if (expr instanceof AggregateFunction && ((AggregateFunction)
expr).isDistinct()) {
return !(expr instanceof SupportMultiDistinct)
|| expr instanceof Count && ((Count)
expr).isDistinct() && expr.arity() > 1;
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java
index 250263c3b99..1b0403e9423 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/util/ExpressionUtils.java
@@ -1129,10 +1129,10 @@ public class ExpressionUtils {
}
/** deapAnyMatch */
- public static boolean deapAnyMatch(
+ public static boolean deepAnyMatch(
Collection<? extends Expression> expressions,
Predicate<TreeNode<Expression>> predicate) {
for (Expression expression : expressions) {
- if (expression.anyMatch(expr -> expr.anyMatch(predicate))) {
+ if (expression.anyMatch(predicate)) {
return true;
}
}
@@ -1140,10 +1140,10 @@ public class ExpressionUtils {
}
/** deapNoneMatch */
- public static boolean deapNoneMatch(
+ public static boolean deepNoneMatch(
Collection<? extends Expression> expressions,
Predicate<TreeNode<Expression>> predicate) {
for (Expression expression : expressions) {
- if (expression.anyMatch(expr -> expr.anyMatch(predicate))) {
+ if (expression.anyMatch(predicate)) {
return false;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]