amorynan commented on code in PR #26270:
URL: https://github.com/apache/doris/pull/26270#discussion_r1379658276


##########
fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java:
##########
@@ -2169,6 +2210,17 @@ public static boolean matchExactType(Type type1, Type 
type2, boolean ignorePreci
                     return false;
                 }
                 return matchExactType(((ArrayType) type2).getItemType(), 
((ArrayType) type1).getItemType());
+            } else if (type2.isMapType()) {
+                // For types array, we also need to check contains null for 
case like
+                // cast(array<not_null(int)> as array<int>)
+                if (!((MapType) type2).getIsKeyContainsNull() == ((MapType) 
type1).getIsKeyContainsNull()) {
+                    return false;
+                }
+                if (!((MapType) type2).getIsValueContainsNull() == ((MapType) 
type1).getIsValueContainsNull()) {

Review Comment:
   done!



##########
fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java:
##########
@@ -2169,6 +2210,17 @@ public static boolean matchExactType(Type type1, Type 
type2, boolean ignorePreci
                     return false;
                 }
                 return matchExactType(((ArrayType) type2).getItemType(), 
((ArrayType) type1).getItemType());
+            } else if (type2.isMapType()) {
+                // For types array, we also need to check contains null for 
case like
+                // cast(array<not_null(int)> as array<int>)
+                if (!((MapType) type2).getIsKeyContainsNull() == ((MapType) 
type1).getIsKeyContainsNull()) {

Review Comment:
   done!



##########
fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java:
##########
@@ -787,9 +788,49 @@ public static Type getAssignmentCompatibleType(Type t1, 
Type t2, boolean strict)
             }
 
             return new ArrayType(itemCompatibleType, 
arrayType1.getContainsNull() || arrayType2.getContainsNull());
-        } else if (t1.isArrayType() && t2.isNull()) {
+        } else if (t1.isMapType() && t2.isMapType()) {
+            MapType mapType1 = (MapType) t1;
+            MapType mapType2 = (MapType) t2;
+            Type keyCompatibleType = 
Type.getAssignmentCompatibleType(mapType1.getKeyType(),
+                    mapType2.getKeyType(), strict);
+            if (keyCompatibleType.isInvalid()) {
+                return keyCompatibleType;

Review Comment:
   done!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to