This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit f076fe862483231627b63bf294627e64a41e60af
Author: morrySnow <[email protected]>
AuthorDate: Wed May 29 11:36:57 2024 +0800

    [fix](Nereids) aggregate combinator should be case-insensitive (#35540)
---
 .../expressions/functions/AggCombinerFunctionBuilder.java  | 14 +++++++-------
 regression-test/suites/function_p0/test_agg_foreach.groovy |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/AggCombinerFunctionBuilder.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/AggCombinerFunctionBuilder.java
index daee9a1c7ed..28b32628741 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/AggCombinerFunctionBuilder.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/AggCombinerFunctionBuilder.java
@@ -63,8 +63,8 @@ public class AggCombinerFunctionBuilder extends 
FunctionBuilder {
     }
 
     @Override
-    public boolean canApply(List<? extends Object> arguments) {
-        if (combinatorSuffix.equals(STATE) || 
combinatorSuffix.equals(FOREACH)) {
+    public boolean canApply(List<?> arguments) {
+        if (combinatorSuffix.equalsIgnoreCase(STATE) || 
combinatorSuffix.equalsIgnoreCase(FOREACH)) {
             return nestedBuilder.canApply(arguments);
         } else {
             if (arguments.size() != 1) {
@@ -123,18 +123,18 @@ public class AggCombinerFunctionBuilder extends 
FunctionBuilder {
     }
 
     @Override
-    public Pair<BoundFunction, AggregateFunction> build(String name, List<? 
extends Object> arguments) {
+    public Pair<BoundFunction, AggregateFunction> build(String name, List<?> 
arguments) {
         String nestedName = getNestedName(name);
-        if (combinatorSuffix.equals(STATE)) {
+        if (combinatorSuffix.equalsIgnoreCase(STATE)) {
             AggregateFunction nestedFunction = buildState(nestedName, 
arguments);
             return Pair.of(new StateCombinator((List<Expression>) arguments, 
nestedFunction), nestedFunction);
-        } else if (combinatorSuffix.equals(MERGE)) {
+        } else if (combinatorSuffix.equalsIgnoreCase(MERGE)) {
             AggregateFunction nestedFunction = buildMergeOrUnion(nestedName, 
arguments);
             return Pair.of(new MergeCombinator((List<Expression>) arguments, 
nestedFunction), nestedFunction);
-        } else if (combinatorSuffix.equals(UNION)) {
+        } else if (combinatorSuffix.equalsIgnoreCase(UNION)) {
             AggregateFunction nestedFunction = buildMergeOrUnion(nestedName, 
arguments);
             return Pair.of(new UnionCombinator((List<Expression>) arguments, 
nestedFunction), nestedFunction);
-        } else if (combinatorSuffix.equals(FOREACH)) {
+        } else if (combinatorSuffix.equalsIgnoreCase(FOREACH)) {
             AggregateFunction nestedFunction = buildForEach(nestedName, 
arguments);
             return Pair.of(new ForEachCombinator((List<Expression>) arguments, 
nestedFunction), nestedFunction);
         }
diff --git a/regression-test/suites/function_p0/test_agg_foreach.groovy 
b/regression-test/suites/function_p0/test_agg_foreach.groovy
index 2c52efec6b1..281fdea6a3b 100644
--- a/regression-test/suites/function_p0/test_agg_foreach.groovy
+++ b/regression-test/suites/function_p0/test_agg_foreach.groovy
@@ -62,9 +62,9 @@ suite("test_agg_foreach") {
     (5,[null,2],[[2],null],[null,'c']);
    """
 
-
+   // this case also test combinator should be case-insensitive
    qt_sql """
-       select min_foreach(a), 
min_by_foreach(a,a),max_foreach(a),max_by_foreach(a,a) , 
avg_foreach(a),avg_weighted_foreach(a,a) from foreach_table ;
+       select min_ForEach(a), 
min_by_foreach(a,a),max_foreach(a),max_by_foreach(a,a) , 
avg_foreach(a),avg_weighted_foreach(a,a) from foreach_table ;
    """
 
    qt_sql """


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to