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

yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new f389cea3a3a branch-4.1: [Fix](nereids) Fix month nullable datetimev2 
literal binding #64459 (#64491)
f389cea3a3a is described below

commit f389cea3a3a519eb639ebaf5fd8db048ef3c6389
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Jun 16 11:27:19 2026 +0800

    branch-4.1: [Fix](nereids) Fix month nullable datetimev2 literal binding 
#64459 (#64491)
    
    Cherry-picked from #64459
    
    Co-authored-by: linrrarity <[email protected]>
---
 .../doris/nereids/trees/expressions/functions/scalar/Month.java       | 2 +-
 regression-test/data/nereids_function_p0/scalar_function/M.out        | 4 +++-
 regression-test/suites/nereids_function_p0/scalar_function/M.groovy   | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Month.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Month.java
index e6e9d1bb851..60acc9b97ff 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Month.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Month.java
@@ -43,7 +43,7 @@ public class Month extends ScalarFunction
 
     private static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
             
FunctionSignature.ret(TinyIntType.INSTANCE).args(DateV2Type.INSTANCE),
-            
FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT)
+            
FunctionSignature.ret(TinyIntType.INSTANCE).args(DateTimeV2Type.WILDCARD)
     );
 
     /**
diff --git a/regression-test/data/nereids_function_p0/scalar_function/M.out 
b/regression-test/data/nereids_function_p0/scalar_function/M.out
index 02b99cffda4..1b66c338a09 100644
--- a/regression-test/data/nereids_function_p0/scalar_function/M.out
+++ b/regression-test/data/nereids_function_p0/scalar_function/M.out
@@ -1565,6 +1565,9 @@ dc5f80c371451aa4fc81c930adc64f60
 3
 3
 
+-- !sql_month_nullable_string_literal --
+12     12      1       1       1       1       \N
+
 -- !sql_month_ceil_DateTime --
 \N
 2012-04-01T00:00
@@ -3004,4 +3007,3 @@ March
 
 -- !bugfix_months_diff_17 --
 1
-
diff --git 
a/regression-test/suites/nereids_function_p0/scalar_function/M.groovy 
b/regression-test/suites/nereids_function_p0/scalar_function/M.groovy
index b7b09829bca..7a70e78431f 100644
--- a/regression-test/suites/nereids_function_p0/scalar_function/M.groovy
+++ b/regression-test/suites/nereids_function_p0/scalar_function/M.groovy
@@ -135,6 +135,7 @@ suite("nereids_scalar_fn_M") {
        qt_sql_month_DateTimeV2_notnull "select month(kdtmv2s1) from 
fn_test_not_nullable order by kdtmv2s1"
        qt_sql_month_DateV2 "select month(kdtv2) from fn_test order by kdtv2"
        qt_sql_month_DateV2_notnull "select month(kdtv2) from 
fn_test_not_nullable order by kdtv2"
+       qt_sql_month_nullable_string_literal "select month(cast('2021-12-31 
12:23:34' as datetimev2(0))), month(nullable('2021-12-31 12:23:34')), 
month(cast('0000-01-01 00:00:00' as datetimev2(0))), month(nullable('0000-01-01 
00:00:00')), month(cast('0000-01-02 00:00:00' as datetimev2(0))), 
month(nullable('0000-01-02 00:00:00')), month(null)"
        qt_sql_month_ceil_DateTime "select month_ceil(kdtm) from fn_test order 
by kdtm"
        qt_sql_month_ceil_DateTime_notnull "select month_ceil(kdtm) from 
fn_test_not_nullable order by kdtm"
        qt_sql_month_ceil_DateTimeV2 "select month_ceil(kdtmv2s1) from fn_test 
order by kdtmv2s1"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to