yujun777 commented on code in PR #53697:
URL: https://github.com/apache/doris/pull/53697#discussion_r2241930677


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Cast.java:
##########
@@ -78,25 +83,8 @@ public <R, C> R accept(ExpressionVisitor<R, C> visitor, C 
context) {
 
     @Override
     public boolean nullable() {
-        if (ConnectContext.get().getSessionVariable().enableStrictCast()) {
-            if (targetType.isNumericType() || targetType.isDateLikeType() || 
targetType.isBooleanType()
-                    || targetType.isIPType()) {
-                return child().nullable();
-            }
-            DataType childDataType = child().getDataType();
-            if (childDataType.isStringLikeType() && 
!targetType.isStringLikeType()) {
-                return true;
-            } else if (!childDataType.isDateLikeType() && 
targetType.isDateLikeType()) {
-                return true;
-            } else if (!childDataType.isTimeType() && targetType.isTimeType()) 
{
-                return true;
-            } else if (childDataType.isJsonType() || targetType.isJsonType()) {
-                return true;
-            } else if (childDataType.isVariantType() || 
targetType.isVariantType()) {
-                return true;
-            } else {
-                return child().nullable();
-            }
+        if (SessionVariable.enableStrictCast()) {

Review Comment:
   in strict mode, cast must succ, or throw error (not return null),  
   but for cast overflow  will return null  or throw error ?



-- 
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]

Reply via email to