zclllyybb commented on code in PR #45558:
URL: https://github.com/apache/doris/pull/45558#discussion_r1891031849


##########
be/src/vec/functions/function.cpp:
##########
@@ -296,45 +296,28 @@ DataTypePtr FunctionBuilderImpl::get_return_type(const 
ColumnsWithTypeAndName& a
 
 bool FunctionBuilderImpl::is_date_or_datetime_or_decimal(
         const DataTypePtr& return_type, const DataTypePtr& func_return_type) 
const {
-    return (is_date_or_datetime(return_type->is_nullable()
-                                        ? 
((DataTypeNullable*)return_type.get())->get_nested_type()
-                                        : return_type) &&
-            is_date_or_datetime(
-                    func_return_type->is_nullable()
-                            ? 
((DataTypeNullable*)func_return_type.get())->get_nested_type()
-                            : func_return_type)) ||
-           (is_date_v2_or_datetime_v2(
-                    return_type->is_nullable()
-                            ? 
((DataTypeNullable*)return_type.get())->get_nested_type()
-                            : return_type) &&
-            is_date_v2_or_datetime_v2(
-                    func_return_type->is_nullable()
-                            ? 
((DataTypeNullable*)func_return_type.get())->get_nested_type()
-                            : func_return_type)) ||
-           // For some date functions such as str_to_date(string, string), 
return_type will
-           // be datetimev2 if users enable datev2 but 
get_return_type(arguments) will still
-           // return datetime. We need keep backward compatibility here.
-           (is_date_v2_or_datetime_v2(
-                    return_type->is_nullable()
-                            ? 
((DataTypeNullable*)return_type.get())->get_nested_type()
-                            : return_type) &&
-            is_date_or_datetime(
-                    func_return_type->is_nullable()
-                            ? 
((DataTypeNullable*)func_return_type.get())->get_nested_type()
-                            : func_return_type)) ||
-           (is_date_or_datetime(return_type->is_nullable()
-                                        ? 
((DataTypeNullable*)return_type.get())->get_nested_type()
-                                        : return_type) &&
-            is_date_v2_or_datetime_v2(
-                    func_return_type->is_nullable()
-                            ? 
((DataTypeNullable*)func_return_type.get())->get_nested_type()
-                            : func_return_type)) ||
-           (is_decimal(return_type->is_nullable()
-                               ? 
((DataTypeNullable*)return_type.get())->get_nested_type()
-                               : return_type) &&
-            is_decimal(func_return_type->is_nullable()
-                               ? 
((DataTypeNullable*)func_return_type.get())->get_nested_type()
-                               : func_return_type));
+    auto expect_return_type = remove_nullable(return_type);

Review Comment:
   等https://github.com/apache/doris/pull/45159合入再来改这块儿吧



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