From 3b217de6c691fdae644979dfe914c051a42aa062 Mon Sep 17 00:00:00 2001 From: koarz <3577087577@qq.com> Date: Sat, 30 Nov 2024 00:31:58 +0800 Subject: [PATCH] remove --- be/src/vec/functions/function.cpp | 71 ------------------------------- be/src/vec/functions/function.h | 9 +--- 2 files changed, 1 insertion(+), 79 deletions(-) diff --git a/be/src/vec/functions/function.cpp b/be/src/vec/functions/function.cpp index 851e430d2f04075..2e34c9d43d606cc 100644 --- a/be/src/vec/functions/function.cpp +++ b/be/src/vec/functions/function.cpp @@ -293,75 +293,4 @@ DataTypePtr FunctionBuilderImpl::get_return_type(const ColumnsWithTypeAndName& a return get_return_type_without_low_cardinality(arguments); } - -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)); -} - -bool FunctionBuilderImpl::is_array_nested_type_date_or_datetime_or_decimal( - const DataTypePtr& return_type, const DataTypePtr& func_return_type) const { - auto return_type_ptr = return_type->is_nullable() - ? ((DataTypeNullable*)return_type.get())->get_nested_type() - : return_type; - auto func_return_type_ptr = - func_return_type->is_nullable() - ? ((DataTypeNullable*)func_return_type.get())->get_nested_type() - : func_return_type; - if (!(is_array(return_type_ptr) && is_array(func_return_type_ptr))) { - return false; - } - auto nested_nullable_return_type_ptr = - (assert_cast(return_type_ptr.get()))->get_nested_type(); - auto nested_nullable_func_return_type = - (assert_cast(func_return_type_ptr.get()))->get_nested_type(); - // There must be nullable inside array type. - if (nested_nullable_return_type_ptr->is_nullable() && - nested_nullable_func_return_type->is_nullable()) { - auto nested_return_type_ptr = - ((DataTypeNullable*)(nested_nullable_return_type_ptr.get()))->get_nested_type(); - auto nested_func_return_type_ptr = - ((DataTypeNullable*)(nested_nullable_func_return_type.get()))->get_nested_type(); - return is_date_or_datetime_or_decimal(nested_return_type_ptr, nested_func_return_type_ptr); - } - return false; -} } // namespace doris::vectorized diff --git a/be/src/vec/functions/function.h b/be/src/vec/functions/function.h index 92282c483948e64..77e21d468bbe55a 100644 --- a/be/src/vec/functions/function.h +++ b/be/src/vec/functions/function.h @@ -271,9 +271,7 @@ class FunctionBuilderImpl : public IFunctionBuilder { // For null constant argument, `get_return_type` would return // Nullable when `use_default_implementation_for_nulls` is true. (return_type->is_nullable() && func_return_type->is_nullable() && - is_nothing(((DataTypeNullable*)func_return_type.get())->get_nested_type())) || - is_date_or_datetime_or_decimal(return_type, func_return_type) || - is_array_nested_type_date_or_datetime_or_decimal(return_type, func_return_type))) { + is_nothing(((DataTypeNullable*)func_return_type.get())->get_nested_type())))) { LOG_WARNING( "function return type check failed, function_name={}, " "expect_return_type={}, real_return_type={}, input_arguments={}", @@ -344,11 +342,6 @@ class FunctionBuilderImpl : public IFunctionBuilder { private: DataTypePtr get_return_type_without_low_cardinality( const ColumnsWithTypeAndName& arguments) const; - - bool is_date_or_datetime_or_decimal(const DataTypePtr& return_type, - const DataTypePtr& func_return_type) const; - bool is_array_nested_type_date_or_datetime_or_decimal( - const DataTypePtr& return_type, const DataTypePtr& func_return_type) const; }; /// Previous function interface.