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

zclll 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 5d331d892bb [Fix](datetime) Fix scale precision problems of datetime 
in fold constant (#55928)
5d331d892bb is described below

commit 5d331d892bb2e758aa76210fa375bb55dc23e336
Author: linrrarity <[email protected]>
AuthorDate: Mon Sep 15 15:17:49 2025 +0800

    [Fix](datetime) Fix scale precision problems of datetime in fold constant 
(#55928)
    
    the ceil and floor function of date type will always return a float num
    with six decimal places of precision when the fold_constant is opened,
    like:
    ```text
    mysql> select year_ceil("2023-07-13 22:28:18", 5);
    +-------------------------------------+
    | year_ceil("2023-07-13 22:28:18", 5) |
    +-------------------------------------+
    | 2026-01-01 00:00:00.000000          |
    +-------------------------------------+
    ```
    
    After fix:
    ```text
    mysql> select year_ceil("2023-07-13 22:28:18", 5);
    +-------------------------------------+
    | year_ceil("2023-07-13 22:28:18", 5) |
    +-------------------------------------+
    | 2026-01-01 00:00:00                 |
    +-------------------------------------+
    ```
    ```text
    mysql> select year_ceil("2023-07-13 22:28:18.123", 5);
    +-----------------------------------------+
    | year_ceil("2023-07-13 22:28:18.123", 5) |
    +-----------------------------------------+
    | 2026-01-01 00:00:00.000                 |
    +-----------------------------------------+
    ```
---
 .../functions/executable/TimeRoundSeries.java      | 368 ++-------------------
 .../expressions/functions/scalar/DayCeil.java      |   8 +-
 .../expressions/functions/scalar/DayFloor.java     |   8 +-
 .../expressions/functions/scalar/HourCeil.java     |   8 +-
 .../expressions/functions/scalar/HourFloor.java    |   8 +-
 .../expressions/functions/scalar/MinuteCeil.java   |   8 +-
 .../expressions/functions/scalar/MinuteFloor.java  |   8 +-
 .../expressions/functions/scalar/MonthCeil.java    |   8 +-
 .../expressions/functions/scalar/MonthFloor.java   |   8 +-
 .../expressions/functions/scalar/SecondCeil.java   |   8 +-
 .../expressions/functions/scalar/SecondFloor.java  |   8 +-
 .../expressions/functions/scalar/WeekCeil.java     |   8 +-
 .../expressions/functions/scalar/WeekFloor.java    |   8 +-
 .../expressions/functions/scalar/YearCeil.java     |   8 +-
 .../expressions/functions/scalar/YearFloor.java    |   8 +-
 .../suites/correctness_p0/test_time_round.groovy   | 130 ++++++++
 16 files changed, 172 insertions(+), 438 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/TimeRoundSeries.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/TimeRoundSeries.java
index 42a75c208da..acde72ed5f2 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/TimeRoundSeries.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/TimeRoundSeries.java
@@ -151,30 +151,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function year-ceil
      */
-    @ExecFunction(name = "year_ceil")
-    public static Expression yearCeil(DateTimeLiteral date) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "year_ceil")
-    public static Expression yearCeil(DateTimeLiteral date, IntegerLiteral 
period) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "year_ceil")
-    public static Expression yearCeil(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), true));
-    }
-
-    @ExecFunction(name = "year_ceil")
-    public static Expression yearCeil(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), true));
-    }
-
     @ExecFunction(name = "year_ceil")
     public static Expression yearCeil(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
@@ -202,13 +178,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "year_ceil")
     public static Expression yearCeil(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
+                1, START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "year_ceil")
     public static Expression yearCeil(DateTimeV2Literal date, IntegerLiteral 
period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
+                period.getValue(), START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "year_ceil")
@@ -253,13 +229,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "quarter_ceil")
     public static Expression quarterCeil(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.QUARTER, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
+                1, START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "quarter_ceil")
     public static Expression quarterCeil(DateTimeV2Literal date, 
IntegerLiteral period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.QUARTER, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
+                period.getValue(), START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "quarter_ceil")
@@ -277,30 +253,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function month-ceil
      */
-    @ExecFunction(name = "month_ceil")
-    public static Expression monthCeil(DateTimeLiteral date) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "month_ceil")
-    public static Expression monthCeil(DateTimeLiteral date, IntegerLiteral 
period) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "month_ceil")
-    public static Expression monthCeil(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), true));
-    }
-
-    @ExecFunction(name = "month_ceil")
-    public static Expression monthCeil(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), true));
-    }
-
     @ExecFunction(name = "month_ceil")
     public static Expression monthCeil(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
@@ -328,13 +280,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "month_ceil")
     public static Expression monthCeil(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
+                1, START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "month_ceil")
     public static Expression monthCeil(DateTimeV2Literal date, IntegerLiteral 
period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
+                period.getValue(), START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "month_ceil")
@@ -352,30 +304,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function day-ceil
      */
-    @ExecFunction(name = "day_ceil")
-    public static Expression dayCeil(DateTimeLiteral date) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "day_ceil")
-    public static Expression dayCeil(DateTimeLiteral date, IntegerLiteral 
period) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "day_ceil")
-    public static Expression dayCeil(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), true));
-    }
-
-    @ExecFunction(name = "day_ceil")
-    public static Expression dayCeil(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), true));
-    }
-
     @ExecFunction(name = "day_ceil")
     public static Expression dayCeil(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
@@ -403,13 +331,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "day_ceil")
     public static Expression dayCeil(DateTimeV2Literal date) {
         return DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
+                1, START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "day_ceil")
     public static Expression dayCeil(DateTimeV2Literal date, IntegerLiteral 
period) {
         return DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
+                period.getValue(), START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "day_ceil")
@@ -427,30 +355,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function hour-ceil
      */
-    @ExecFunction(name = "hour_ceil")
-    public static Expression hourCeil(DateTimeLiteral date) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "hour_ceil")
-    public static Expression hourCeil(DateTimeLiteral date, IntegerLiteral 
period) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "hour_ceil")
-    public static Expression hourCeil(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), true));
-    }
-
-    @ExecFunction(name = "hour_ceil")
-    public static Expression hourCeil(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), true));
-    }
-
     @ExecFunction(name = "hour_ceil")
     public static Expression hourCeil(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
@@ -478,13 +382,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "hour_ceil")
     public static Expression hourCeil(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
+                1, START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "hour_ceil")
     public static Expression hourCeil(DateTimeV2Literal date, IntegerLiteral 
period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
+                period.getValue(), START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "hour_ceil")
@@ -502,30 +406,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function minute-ceil
      */
-    @ExecFunction(name = "minute_ceil")
-    public static Expression minuteCeil(DateTimeLiteral date) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "minute_ceil")
-    public static Expression minuteCeil(DateTimeLiteral date, IntegerLiteral 
period) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "minute_ceil")
-    public static Expression minuteCeil(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), true));
-    }
-
-    @ExecFunction(name = "minute_ceil")
-    public static Expression minuteCeil(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), true));
-    }
-
     @ExecFunction(name = "minute_ceil")
     public static Expression minuteCeil(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
@@ -553,13 +433,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "minute_ceil")
     public static Expression minuteCeil(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
+                1, START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "minute_ceil")
     public static Expression minuteCeil(DateTimeV2Literal date, IntegerLiteral 
period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
+                period.getValue(), START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "minute_ceil")
@@ -578,30 +458,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function SECOND-ceil
      */
-    @ExecFunction(name = "second_ceil")
-    public static Expression secondCeil(DateTimeLiteral date) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "second_ceil")
-    public static Expression secondCeil(DateTimeLiteral date, IntegerLiteral 
period) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
-    }
-
-    @ExecFunction(name = "second_ceil")
-    public static Expression secondCeil(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), true));
-    }
-
-    @ExecFunction(name = "second_ceil")
-    public static Expression secondCeil(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), true));
-    }
-
     @ExecFunction(name = "second_ceil")
     public static Expression secondCeil(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
@@ -629,13 +485,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "second_ceil")
     public static Expression secondCeil(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, true));
+                1, START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "second_ceil")
     public static Expression secondCeil(DateTimeV2Literal date, IntegerLiteral 
period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, true));
+                period.getValue(), START_ORIGINAL_DAY, true), date.getScale());
     }
 
     @ExecFunction(name = "second_ceil")
@@ -654,30 +510,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function year-floor
      */
-    @ExecFunction(name = "year_floor")
-    public static Expression yearFloor(DateTimeLiteral date) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "year_floor")
-    public static Expression yearFloor(DateTimeLiteral date, IntegerLiteral 
period) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "year_floor")
-    public static Expression yearFloor(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), false));
-    }
-
-    @ExecFunction(name = "year_floor")
-    public static Expression yearFloor(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), false));
-    }
-
     @ExecFunction(name = "year_floor")
     public static Expression yearFloor(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
@@ -705,13 +537,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "year_floor")
     public static Expression yearFloor(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
+                1, START_ORIGINAL_DAY, false), date.getScale());
     }
 
     @ExecFunction(name = "year_floor")
     public static Expression yearFloor(DateTimeV2Literal date, IntegerLiteral 
period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.YEAR, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
+                period.getValue(), START_ORIGINAL_DAY, false), 
date.getScale());
     }
 
     @ExecFunction(name = "year_floor")
@@ -729,30 +561,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function quarter-floor
      */
-    @ExecFunction(name = "quarter_floor")
-    public static Expression quarterFloor(DateTimeLiteral date) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.QUARTER, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "quarter_floor")
-    public static Expression quarterFloor(DateTimeLiteral date, IntegerLiteral 
period) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.QUARTER, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "quarter_floor")
-    public static Expression quarterFloor(DateTimeLiteral date, 
DateTimeLiteral origin) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.QUARTER, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), false));
-    }
-
-    @ExecFunction(name = "quarter_floor")
-    public static Expression quarterFloor(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.QUARTER, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), false));
-    }
-
     @ExecFunction(name = "quarter_floor")
     public static Expression quarterFloor(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.QUARTER, 
date.toJavaDateType(),
@@ -780,13 +588,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "quarter_floor")
     public static Expression quarterFloor(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.QUARTER, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
+                1, START_ORIGINAL_DAY, false), date.getScale());
     }
 
     @ExecFunction(name = "quarter_floor")
     public static Expression quarterFloor(DateTimeV2Literal date, 
IntegerLiteral period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.QUARTER, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
+                period.getValue(), START_ORIGINAL_DAY, false), 
date.getScale());
     }
 
     @ExecFunction(name = "quarter_floor")
@@ -805,30 +613,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function month-floor
      */
-    @ExecFunction(name = "month_floor")
-    public static Expression monthFloor(DateTimeLiteral date) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "month_floor")
-    public static Expression monthFloor(DateTimeLiteral date, IntegerLiteral 
period) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "month_floor")
-    public static Expression monthFloor(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), false));
-    }
-
-    @ExecFunction(name = "month_floor")
-    public static Expression monthFloor(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), false));
-    }
-
     @ExecFunction(name = "month_floor")
     public static Expression monthFloor(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
@@ -856,13 +640,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "month_floor")
     public static Expression monthFloor(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
+                1, START_ORIGINAL_DAY, false), date.getScale());
     }
 
     @ExecFunction(name = "month_floor")
     public static Expression monthFloor(DateTimeV2Literal date, IntegerLiteral 
period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MONTH, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
+                period.getValue(), START_ORIGINAL_DAY, false), 
date.getScale());
     }
 
     @ExecFunction(name = "month_floor")
@@ -881,30 +665,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function day-floor
      */
-    @ExecFunction(name = "day_floor")
-    public static Expression dayFloor(DateTimeLiteral date) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "day_floor")
-    public static Expression dayFloor(DateTimeLiteral date, IntegerLiteral 
period) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "day_floor")
-    public static Expression dayFloor(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), false));
-    }
-
-    @ExecFunction(name = "day_floor")
-    public static Expression dayFloor(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), false));
-    }
-
     @ExecFunction(name = "day_floor")
     public static Expression dayFloor(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
@@ -932,13 +692,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "day_floor")
     public static Expression dayFloor(DateTimeV2Literal date) {
         return DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
+                1, START_ORIGINAL_DAY, false), date.getScale());
     }
 
     @ExecFunction(name = "day_floor")
     public static Expression dayFloor(DateTimeV2Literal date, IntegerLiteral 
period) {
         return DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.DAY, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
+                period.getValue(), START_ORIGINAL_DAY, false), 
date.getScale());
     }
 
     @ExecFunction(name = "day_floor")
@@ -956,30 +716,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function hour-floor
      */
-    @ExecFunction(name = "hour_floor")
-    public static Expression hourFloor(DateTimeLiteral date) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "hour_floor")
-    public static Expression hourFloor(DateTimeLiteral date, IntegerLiteral 
period) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "hour_floor")
-    public static Expression hourFloor(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), false));
-    }
-
-    @ExecFunction(name = "hour_floor")
-    public static Expression hourFloor(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), false));
-    }
-
     @ExecFunction(name = "hour_floor")
     public static Expression hourFloor(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
@@ -1007,13 +743,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "hour_floor")
     public static Expression hourFloor(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
+                1, START_ORIGINAL_DAY, false), date.getScale());
     }
 
     @ExecFunction(name = "hour_floor")
     public static Expression hourFloor(DateTimeV2Literal date, IntegerLiteral 
period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.HOUR, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
+                period.getValue(), START_ORIGINAL_DAY, false), 
date.getScale());
     }
 
     @ExecFunction(name = "hour_floor")
@@ -1031,30 +767,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function minute-floor
      */
-    @ExecFunction(name = "minute_floor")
-    public static Expression minuteFloor(DateTimeLiteral date) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "minute_floor")
-    public static Expression minuteFloor(DateTimeLiteral date, IntegerLiteral 
period) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "minute_floor")
-    public static Expression minuteFloor(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), false));
-    }
-
-    @ExecFunction(name = "minute_floor")
-    public static Expression minuteFloor(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), false));
-    }
-
     @ExecFunction(name = "minute_floor")
     public static Expression minuteFloor(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
@@ -1082,13 +794,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "minute_floor")
     public static Expression minuteFloor(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
+                1, START_ORIGINAL_DAY, false), date.getScale());
     }
 
     @ExecFunction(name = "minute_floor")
     public static Expression minuteFloor(DateTimeV2Literal date, 
IntegerLiteral period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.MINUTE, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
+                period.getValue(), START_ORIGINAL_DAY, false), 
date.getScale());
     }
 
     @ExecFunction(name = "minute_floor")
@@ -1107,30 +819,6 @@ public class TimeRoundSeries {
     /**
      * datetime arithmetic function SECOND-floor
      */
-    @ExecFunction(name = "second_floor")
-    public static Expression secondFloor(DateTimeLiteral date) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "second_floor")
-    public static Expression secondFloor(DateTimeLiteral date, IntegerLiteral 
period) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
-    }
-
-    @ExecFunction(name = "second_floor")
-    public static Expression secondFloor(DateTimeLiteral date, DateTimeLiteral 
origin) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                1, origin.toJavaDateType(), false));
-    }
-
-    @ExecFunction(name = "second_floor")
-    public static Expression secondFloor(DateTimeLiteral date, IntegerLiteral 
period, DateTimeLiteral origin) {
-        return 
DateTimeLiteral.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                period.getValue(), origin.toJavaDateType(), false));
-    }
-
     @ExecFunction(name = "second_floor")
     public static Expression secondFloor(DateV2Literal date) {
         return DateV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
@@ -1158,13 +846,13 @@ public class TimeRoundSeries {
     @ExecFunction(name = "second_floor")
     public static Expression secondFloor(DateTimeV2Literal date) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                1, START_ORIGINAL_DAY, false));
+                1, START_ORIGINAL_DAY, false), date.getScale());
     }
 
     @ExecFunction(name = "second_floor")
     public static Expression secondFloor(DateTimeV2Literal date, 
IntegerLiteral period) {
         return 
DateTimeV2Literal.fromJavaDateType(getDateCeilOrFloor(DATE.SECOND, 
date.toJavaDateType(),
-                period.getValue(), START_ORIGINAL_DAY, false));
+                period.getValue(), START_ORIGINAL_DAY, false), 
date.getScale());
     }
 
     @ExecFunction(name = "second_floor")
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayCeil.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayCeil.java
index 7074ee8d5f3..a5f6d1a15a9 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayCeil.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayCeil.java
@@ -24,7 +24,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonoton
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import 
org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.DateV2Type;
 import org.apache.doris.nereids.types.IntegerType;
@@ -52,12 +51,7 @@ public class DayCeil extends ScalarFunction
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
DateV2Type.INSTANCE),
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
IntegerType.INSTANCE),
             FunctionSignature.ret(DateV2Type.INSTANCE)
-                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayFloor.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayFloor.java
index 2a0eb1d9674..a1594c8c327 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayFloor.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DayFloor.java
@@ -24,7 +24,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonoton
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import 
org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.DateV2Type;
 import org.apache.doris.nereids.types.IntegerType;
@@ -52,12 +51,7 @@ public class DayFloor extends ScalarFunction
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
DateV2Type.INSTANCE),
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
IntegerType.INSTANCE),
             FunctionSignature.ret(DateV2Type.INSTANCE)
-                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourCeil.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourCeil.java
index 5d09da0f312..ca42c9b2a2c 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourCeil.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourCeil.java
@@ -24,7 +24,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonoton
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import 
org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.IntegerType;
 
@@ -46,12 +45,7 @@ public class HourCeil extends ScalarFunction
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
                     .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE),
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
-                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourFloor.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourFloor.java
index 982b75f8569..7e752fbe272 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourFloor.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/HourFloor.java
@@ -24,7 +24,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonoton
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import 
org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.IntegerType;
 
@@ -46,12 +45,7 @@ public class HourFloor extends ScalarFunction
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
                     .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE),
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
-                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteCeil.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteCeil.java
index c904695734e..b0c033ce9af 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteCeil.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteCeil.java
@@ -23,7 +23,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
 import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonotonic;
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.IntegerType;
 
@@ -45,12 +44,7 @@ public class MinuteCeil extends ScalarFunction
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
                     .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE),
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
-                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteFloor.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteFloor.java
index e9fa548c9bf..7d5c52205a8 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteFloor.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MinuteFloor.java
@@ -23,7 +23,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
 import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonotonic;
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.IntegerType;
 
@@ -45,12 +44,7 @@ public class MinuteFloor extends ScalarFunction
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
                     .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE),
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
-                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthCeil.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthCeil.java
index 061b1af041f..050ee5a3c09 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthCeil.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthCeil.java
@@ -24,7 +24,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonoton
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import 
org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.DateV2Type;
 import org.apache.doris.nereids.types.IntegerType;
@@ -52,12 +51,7 @@ public class MonthCeil extends ScalarFunction
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
DateV2Type.INSTANCE),
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
IntegerType.INSTANCE),
             FunctionSignature.ret(DateV2Type.INSTANCE)
-                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthFloor.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthFloor.java
index bb32ce3af12..7b30708d70b 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthFloor.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/MonthFloor.java
@@ -24,7 +24,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonoton
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import 
org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.DateV2Type;
 import org.apache.doris.nereids.types.IntegerType;
@@ -52,12 +51,7 @@ public class MonthFloor extends ScalarFunction
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
DateV2Type.INSTANCE),
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
IntegerType.INSTANCE),
             FunctionSignature.ret(DateV2Type.INSTANCE)
-                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondCeil.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondCeil.java
index 7d613078eea..9c2c679feba 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondCeil.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondCeil.java
@@ -24,7 +24,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonoton
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import 
org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.IntegerType;
 
@@ -46,12 +45,7 @@ public class SecondCeil extends ScalarFunction
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
                     .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE),
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
-                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondFloor.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondFloor.java
index ea79a4a67f1..c4bbd25abe3 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondFloor.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/SecondFloor.java
@@ -24,7 +24,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonoton
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import 
org.apache.doris.nereids.trees.expressions.functions.PropagateNullLiteral;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.IntegerType;
 
@@ -46,12 +45,7 @@ public class SecondFloor extends ScalarFunction
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
                     .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE),
             FunctionSignature.ret(DateTimeV2Type.SYSTEM_DEFAULT)
-                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateTimeV2Type.SYSTEM_DEFAULT, IntegerType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT)
 
     );
 
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekCeil.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekCeil.java
index 87d58bf187d..47bb96546b4 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekCeil.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekCeil.java
@@ -22,7 +22,6 @@ import org.apache.doris.nereids.trees.expressions.Expression;
 import org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.DateV2Type;
 import org.apache.doris.nereids.types.IntegerType;
@@ -50,12 +49,7 @@ public class WeekCeil extends ScalarFunction
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
DateV2Type.INSTANCE),
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
IntegerType.INSTANCE),
             FunctionSignature.ret(DateV2Type.INSTANCE)
-                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekFloor.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekFloor.java
index a92dd533508..26c42511427 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekFloor.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/WeekFloor.java
@@ -22,7 +22,6 @@ import org.apache.doris.nereids.trees.expressions.Expression;
 import org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.DateV2Type;
 import org.apache.doris.nereids.types.IntegerType;
@@ -50,12 +49,7 @@ public class WeekFloor extends ScalarFunction
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
DateV2Type.INSTANCE),
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
IntegerType.INSTANCE),
             FunctionSignature.ret(DateV2Type.INSTANCE)
-                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearCeil.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearCeil.java
index ff4252380e9..32dd4fdfb35 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearCeil.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearCeil.java
@@ -23,7 +23,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
 import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonotonic;
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.DateV2Type;
 import org.apache.doris.nereids.types.IntegerType;
@@ -51,12 +50,7 @@ public class YearCeil extends ScalarFunction
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
DateV2Type.INSTANCE),
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
IntegerType.INSTANCE),
             FunctionSignature.ret(DateV2Type.INSTANCE)
-                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE)
     );
 
     /**
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearFloor.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearFloor.java
index 41f7bbec9f6..e1af0592cd1 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearFloor.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/YearFloor.java
@@ -23,7 +23,6 @@ import 
org.apache.doris.nereids.trees.expressions.functions.AlwaysNullable;
 import 
org.apache.doris.nereids.trees.expressions.functions.DateCeilFloorMonotonic;
 import 
org.apache.doris.nereids.trees.expressions.functions.ExplicitlyCastableSignature;
 import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
-import org.apache.doris.nereids.types.DateTimeType;
 import org.apache.doris.nereids.types.DateTimeV2Type;
 import org.apache.doris.nereids.types.DateV2Type;
 import org.apache.doris.nereids.types.IntegerType;
@@ -51,12 +50,7 @@ public class YearFloor extends ScalarFunction
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
DateV2Type.INSTANCE),
             
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateV2Type.INSTANCE, 
IntegerType.INSTANCE),
             FunctionSignature.ret(DateV2Type.INSTANCE)
-                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
DateTimeType.INSTANCE),
-            
FunctionSignature.ret(DateTimeType.INSTANCE).args(DateTimeType.INSTANCE, 
IntegerType.INSTANCE),
-            FunctionSignature.ret(DateTimeType.INSTANCE)
-                    .args(DateTimeType.INSTANCE, IntegerType.INSTANCE, 
DateTimeType.INSTANCE)
+                    .args(DateV2Type.INSTANCE, IntegerType.INSTANCE, 
DateV2Type.INSTANCE)
     );
 
     /**
diff --git a/regression-test/suites/correctness_p0/test_time_round.groovy 
b/regression-test/suites/correctness_p0/test_time_round.groovy
index f387b51ed1d..be69ac2404f 100644
--- a/regression-test/suites/correctness_p0/test_time_round.groovy
+++ b/regression-test/suites/correctness_p0/test_time_round.groovy
@@ -294,4 +294,134 @@ suite("test_time_round") {
     testFoldConst("select quarter_floor('2020-04-02');")
     testFoldConst("select quarter_floor('2020-05-01');")
     testFoldConst("select quarter_floor('2020-05-02');")
+
+    testFoldConst("select year_ceil('2025-09-10 12:34:56')")
+    testFoldConst("select year_ceil('2025-09-10 12:34:56', 2)")
+    testFoldConst("select year_ceil('2025-09-10 12:34:56', '2020-01-01 
00:00:00')")
+    testFoldConst("select year_ceil('2025-09-10 12:34:56', 3, '2020-01-01 
00:00:00')")
+    testFoldConst("select year_ceil('2025-09-10 12:34:56.123')")
+    testFoldConst("select year_ceil('2025-09-10 12:34:56.12345', 2)")
+    testFoldConst("select year_ceil('2025-09-10 12:34:56.1', '2020-01-01 
00:00:00.5')")
+    testFoldConst("select year_ceil('2025-09-10 12:34:56.123456', 3, 
'2020-01-01 00:00:00.789')")
+    
+    testFoldConst("select year_floor('2025-09-10 12:34:56')")
+    testFoldConst("select year_floor('2025-09-10 12:34:56', 2)")
+    testFoldConst("select year_floor('2025-09-10 12:34:56', '2020-01-01 
00:00:00')")
+    testFoldConst("select year_floor('2025-09-10 12:34:56', 3, '2020-01-01 
00:00:00')")
+    testFoldConst("select year_floor('2025-09-10 12:34:56.456')")
+    testFoldConst("select year_floor('2025-09-10 12:34:56.78', 2)")
+    testFoldConst("select year_floor('2025-09-10 12:34:56.9012', '2020-01-01 
00:00:00.345')")
+    testFoldConst("select year_floor('2025-09-10 12:34:56.67', 3, '2020-01-01 
00:00:00.12')")
+
+    testFoldConst("select quarter_ceil('2025-09-10 12:34:56')")
+    testFoldConst("select quarter_ceil('2025-09-10 12:34:56', 2)")
+    testFoldConst("select quarter_ceil('2025-09-10 12:34:56', '2020-01-01 
00:00:00')")
+    testFoldConst("select quarter_ceil('2025-09-10 12:34:56', 3, '2020-01-01 
00:00:00')")
+    testFoldConst("select quarter_ceil('2025-09-10 12:34:56.789')")
+    testFoldConst("select quarter_ceil('2025-09-10 12:34:56.23', 2)")
+    testFoldConst("select quarter_ceil('2025-09-10 12:34:56.5678', '2020-01-01 
00:00:00.9')")
+    testFoldConst("select quarter_ceil('2025-09-10 12:34:56.34', 3, 
'2020-01-01 00:00:00.567')")
+
+    testFoldConst("select quarter_floor('2025-09-10 12:34:56')")
+    testFoldConst("select quarter_floor('2025-09-10 12:34:56', 2)")
+    testFoldConst("select quarter_floor('2025-09-10 12:34:56', '2020-01-01 
00:00:00')")
+    testFoldConst("select quarter_floor('2025-09-10 12:34:56', 3, '2020-01-01 
00:00:00')")
+    testFoldConst("select quarter_floor('2025-09-10 12:34:56.456789')")
+    testFoldConst("select quarter_floor('2025-09-10 12:34:56.89', 2)")
+    testFoldConst("select quarter_floor('2025-09-10 12:34:56.12', '2020-01-01 
00:00:00.3456')")
+    testFoldConst("select quarter_floor('2025-09-10 12:34:56.678', 3, 
'2020-01-01 00:00:00.91')")
+
+    testFoldConst("select month_ceil('2025-09-10 12:34:56')")
+    testFoldConst("select month_ceil('2025-09-10 12:34:56', 2)")
+    testFoldConst("select month_ceil('2025-09-10 12:34:56', '2020-01-01 
00:00:00')")
+    testFoldConst("select month_ceil('2025-09-10 12:34:56', 3, '2020-01-01 
00:00:00')")
+    testFoldConst("select month_ceil('2025-09-10 12:34:56.2')")
+    testFoldConst("select month_ceil('2025-09-10 12:34:56.4567', 2)")
+    testFoldConst("select month_ceil('2025-09-10 12:34:56.89012', '2020-01-01 
00:00:00.123')")
+    testFoldConst("select month_ceil('2025-09-10 12:34:56.345', 3, '2020-01-01 
00:00:00.6789')")
+
+    testFoldConst("select month_floor('2025-09-10 12:34:56')")
+    testFoldConst("select month_floor('2025-09-10 12:34:56', 2)")
+    testFoldConst("select month_floor('2025-09-10 12:34:56', '2020-01-01 
00:00:00')")
+    testFoldConst("select month_floor('2025-09-10 12:34:56', 3, '2020-01-01 
00:00:00')")
+    testFoldConst("select month_floor('2025-09-10 12:34:56.87')")
+    testFoldConst("select month_floor('2025-09-10 12:34:56.345678', 2)")
+    testFoldConst("select month_floor('2025-09-10 12:34:56.67', '2020-01-01 
00:00:00.8901')")
+    testFoldConst("select month_floor('2025-09-10 12:34:56.234', 3, 
'2020-01-01 00:00:00.56')")
+
+    testFoldConst("select day_ceil('2025-09-10 12:34:56')")
+    testFoldConst("select day_ceil('2025-09-10 12:34:56', 3)")
+    testFoldConst("select day_ceil('2025-09-10 12:34:56', '2025-09-01 
00:00:00')")
+    testFoldConst("select day_ceil('2025-09-10 12:34:56', 5, '2025-09-01 
00:00:00')")
+    testFoldConst("select day_ceil('2025-09-10 12:34:56.678')")
+    testFoldConst("select day_ceil('2025-09-10 12:34:56.12', 3)")
+    testFoldConst("select day_ceil('2025-09-10 12:34:56.45678', '2025-09-01 
00:00:00.789')")
+    testFoldConst("select day_ceil('2025-09-10 12:34:56.9', 5, '2025-09-01 
00:00:00.123456')")
+
+    testFoldConst("select day_floor('2025-09-10 12:34:56')")
+    testFoldConst("select day_floor('2025-09-10 12:34:56', 3)")
+    testFoldConst("select day_floor('2025-09-10 12:34:56', '2025-09-01 
00:00:00')")
+    testFoldConst("select day_floor('2025-09-10 12:34:56', 5, '2025-09-01 
00:00:00')")
+    testFoldConst("select day_floor('2025-09-10 12:34:56.3456')")
+    testFoldConst("select day_floor('2025-09-10 12:34:56.789', 3)")
+    testFoldConst("select day_floor('2025-09-10 12:34:56.12345', '2025-09-01 
00:00:00.67')")
+    testFoldConst("select day_floor('2025-09-10 12:34:56.56', 5, '2025-09-01 
00:00:00.8901')")
+
+    testFoldConst("select hour_ceil('2025-09-10 12:34:56')")
+    testFoldConst("select hour_ceil('2025-09-10 12:34:56', 3)")
+    testFoldConst("select hour_ceil('2025-09-10 12:34:56', '2025-09-10 
10:00:00')")
+    testFoldConst("select hour_ceil('2025-09-10 12:34:56', 6, '2025-09-10 
10:00:00')")
+    testFoldConst("select hour_ceil('2025-09-10 12:34:56.123456')")
+    testFoldConst("select hour_ceil('2025-09-10 12:34:56.78', 3)")
+    testFoldConst("select hour_ceil('2025-09-10 12:34:56.456', '2025-09-10 
10:00:00.789')")
+    testFoldConst("select hour_ceil('2025-09-10 12:34:56.12', 6, '2025-09-10 
10:00:00.3456')")
+
+    testFoldConst("select hour_floor('2025-09-10 12:34:56')")
+    testFoldConst("select hour_floor('2025-09-10 12:34:56', 3)")
+    testFoldConst("select hour_floor('2025-09-10 12:34:56', '2025-09-10 
10:00:00')")
+    testFoldConst("select hour_floor('2025-09-10 12:34:56', 6, '2025-09-10 
10:00:00')")
+    testFoldConst("select hour_floor('2025-09-10 12:34:56.5678')")
+    testFoldConst("select hour_floor('2025-09-10 12:34:56.234', 3)")
+    testFoldConst("select hour_floor('2025-09-10 12:34:56.89012', '2025-09-10 
10:00:00.456')")
+    testFoldConst("select hour_floor('2025-09-10 12:34:56.67', 6, '2025-09-10 
10:00:00.123')")
+
+    testFoldConst("select minute_ceil('2025-09-10 12:34:56')")
+    testFoldConst("select minute_ceil('2025-09-10 12:34:56', 5)")
+    testFoldConst("select minute_ceil('2025-09-10 12:34:56', '2025-09-10 
12:30:00')")
+    testFoldConst("select minute_ceil('2025-09-10 12:34:56', 10, '2025-09-10 
12:30:00')")
+    testFoldConst("select minute_ceil('2025-09-10 12:34:56.789')")
+    testFoldConst("select minute_ceil('2025-09-10 12:34:56.45', 5)")
+    testFoldConst("select minute_ceil('2025-09-10 12:34:56.12345', '2025-09-10 
12:30:00.678')")
+    testFoldConst("select minute_ceil('2025-09-10 12:34:56.9', 10, '2025-09-10 
12:30:00.234567')")
+
+    testFoldConst("select minute_floor('2025-09-10 12:34:56')")
+    testFoldConst("select minute_floor('2025-09-10 12:34:56', 5)")
+    testFoldConst("select minute_floor('2025-09-10 12:34:56', '2025-09-10 
12:30:00')")
+    testFoldConst("select minute_floor('2025-09-10 12:34:56', 10, '2025-09-10 
12:30:00')")
+    testFoldConst("select minute_floor('2025-09-10 12:34:56.456789')")
+    testFoldConst("select minute_floor('2025-09-10 12:34:56.123', 5)")
+    testFoldConst("select minute_floor('2025-09-10 12:34:56.78', '2025-09-10 
12:30:00.45')")
+    testFoldConst("select minute_floor('2025-09-10 12:34:56.34567', 10, 
'2025-09-10 12:30:00.891')")
+
+    testFoldConst("select second_ceil('2025-09-10 12:34:56')")
+    testFoldConst("select second_ceil('2025-09-10 12:34:56', 7)")
+    testFoldConst("select second_ceil('2025-09-10 12:34:56', 7, '2025-09-10 
12:34:50')")
+    testFoldConst("select second_ceil('2025-09-10 12:34:56', '2025-09-10 
12:34:50')")
+    testFoldConst("select second_ceil('2025-09-10 12:34:56', 15, '2025-09-10 
12:34:30')")
+    testFoldConst("select second_ceil('2025-09-10 12:34:56.234')")
+    testFoldConst("select second_ceil('2025-09-10 12:34:56.56789', 7)")
+    testFoldConst("select second_ceil('2025-09-10 12:34:56.12', 7, '2025-09-10 
12:34:50.345')")
+    testFoldConst("select second_ceil('2025-09-10 12:34:56.8901', '2025-09-10 
12:34:50.67')")
+    testFoldConst("select second_ceil('2025-09-10 12:34:56.123456', 15, 
'2025-09-10 12:34:30.789')")
+
+    testFoldConst("select second_floor('2025-09-10 12:34:56')")
+    testFoldConst("select second_floor('2025-09-10 12:34:56', 7)")
+    testFoldConst("select second_floor('2025-09-10 12:34:56', '2025-09-10 
12:34:50')")
+    testFoldConst("select second_floor('2025-09-10 12:34:56', 7, '2025-09-10 
12:34:50')")
+    testFoldConst("select second_floor('2025-09-10 12:34:56', 15, '2025-09-10 
12:34:30')")
+    testFoldConst("select second_floor('2025-09-10 12:34:56.678')")
+    testFoldConst("select second_floor('2025-09-10 12:34:56.234567', 7)")
+    testFoldConst("select second_floor('2025-09-10 12:34:56.45', '2025-09-10 
12:34:50.123')")
+    testFoldConst("select second_floor('2025-09-10 12:34:56.8901', 7, 
'2025-09-10 12:34:50.234')")
+    testFoldConst("select second_floor('2025-09-10 12:34:56.12', 15, 
'2025-09-10 12:34:30.567890')")
 }


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

Reply via email to