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

xuyang 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 fef37990a3 [fix](array-type) Fix incorrect in function-set for array 
type (#11585)
fef37990a3 is described below

commit fef37990a39a2404dd49ee835947665d51b66d83
Author: xy720 <22125576+xy...@users.noreply.github.com>
AuthorDate: Mon Aug 15 21:29:57 2022 +0800

    [fix](array-type) Fix incorrect in function-set for array type (#11585)
    
    There is some wrong logic in FunctionSet.java and it may causes potential 
risks for array functions invoke.
---
 fe/fe-core/src/main/java/org/apache/doris/catalog/ArrayType.java   | 2 +-
 fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/ArrayType.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/ArrayType.java
index a2a9092b10..4e1441fdbe 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/ArrayType.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/ArrayType.java
@@ -118,7 +118,7 @@ public class ArrayType extends Type {
             return false;
         }
         ArrayType otherArrayType = (ArrayType) other;
-        return otherArrayType.itemType.equals(itemType);
+        return otherArrayType.itemType.equals(itemType) && 
otherArrayType.containsNull == containsNull;
     }
 
     public static boolean canCastTo(ArrayType type, ArrayType targetType) {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java
index 5e9b89c790..fd6fad49f9 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java
@@ -1200,7 +1200,7 @@ public class FunctionSet<T> {
         if (!(descArgTypes[0] instanceof ScalarType)
                 || !(candicateArgTypes[0] instanceof ScalarType)) {
             if (candicateArgTypes[0] instanceof ArrayType) {
-                return candicateArgTypes[0].matchesType(descArgTypes[0]);
+                return descArgTypes[0].matchesType(candicateArgTypes[0]);
             }
 
             return false;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to