This is an automated email from the ASF dual-hosted git repository.

gabriellee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 3294b18674 [Improvement](datev2) fix some compatible problems for 
datev2 (#13079)
3294b18674 is described below

commit 3294b186745903989fec284e6689b415ca07a66a
Author: Gabriel <gabrielleeb...@gmail.com>
AuthorDate: Fri Sep 30 13:56:01 2022 +0800

    [Improvement](datev2) fix some compatible problems for datev2 (#13079)
---
 be/src/vec/functions/function_cast.h      | 2 ++
 be/src/vec/functions/to_time_function.cpp | 2 ++
 gensrc/script/doris_builtins_functions.py | 2 +-
 3 files changed, 5 insertions(+), 1 deletion(-)

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<ToDataType> &&
                                              IsDateTimeV2Type<FromDataType>) {
                             DataTypeDateTimeV2::cast_to_date(vec_from[i], 
vec_to[i]);
+                        } else if constexpr (IsDateType<ToDataType> && 
IsDateV2Type<FromDataType>) {
+                            DataTypeDateV2::cast_to_date(vec_from[i], 
vec_to[i]);
                         }
                     } else {
                         if constexpr (IsDateTimeV2Type<FromDataType>) {
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<FunctionDateTimeV2ToDays>();
     factory.register_function<FunctionDateTimeV2ToDate>();
     factory.register_function<FunctionDateTimeV2Date>();
+    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'],
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to