diff --git a/be/src/vec/functions/function_cast.h b/be/src/vec/functions/function_cast.h index 80d8ac9269..bc3a08a7d5 100644 --- a/be/src/vec/functions/function_cast.h +++ b/be/src/vec/functions/function_cast.h @@ -174,6 +174,8 @@ struct ConvertImpl { } else if constexpr (IsDateTimeV2Type && IsDateTimeV2Type) { DataTypeDateTimeV2::cast_to_date(vec_from[i], vec_to[i]); + } else if constexpr (IsDateType && IsDateV2Type) { + DataTypeDateV2::cast_to_date(vec_from[i], vec_to[i]); } } else { if constexpr (IsDateTimeV2Type) { diff --git a/be/src/vec/functions/to_time_function.cpp b/be/src/vec/functions/to_time_function.cpp index 480cb0d720..d3ee548fc9 100644 --- a/be/src/vec/functions/to_time_function.cpp +++ b/be/src/vec/functions/to_time_function.cpp @@ -149,6 +149,8 @@ void register_function_to_time_function(SimpleFunctionFactory& factory) { factory.register_function(); factory.register_function(); factory.register_function(); + factory.register_alias("date", "datev2"); + factory.register_alias("to_date", "to_datev2"); } } // namespace doris::vectorized diff --git a/gensrc/script/doris_builtins_functions.py b/gensrc/script/doris_builtins_functions.py index 61b612af08..6fd59090c7 100755 --- a/gensrc/script/doris_builtins_functions.py +++ b/gensrc/script/doris_builtins_functions.py @@ -1101,7 +1101,7 @@ visible_functions = [ '15FunctionContextENS2_18FunctionStateScopeE', '_ZN5doris18TimestampFunctions12format_closeEPN9doris_udf' '15FunctionContextENS2_18FunctionStateScopeE', 'vec', 'ALWAYS_NULLABLE'], - [['date', 'to_date'], 'DATEV2', ['DATETIMEV2'], + [['date', 'to_date', 'datev2', 'to_datev2'], 'DATEV2', ['DATETIMEV2'], '_ZN5doris18TimestampFunctions7to_dateEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'],