morrySnow commented on code in PR #26270:
URL: https://github.com/apache/doris/pull/26270#discussion_r1379536737
##########
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:
```suggestion
if (((MapType) type2).getIsKeyContainsNull() != ((MapType)
type1).getIsKeyContainsNull()) {
```
##########
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:
```suggestion
if (((MapType) type2).getIsValueContainsNull() != ((MapType)
type1).getIsValueContainsNull()) {
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]