Skip to content

Commit 845bacc

Browse files
committed
last
1 parent 6da3eda commit 845bacc

36 files changed

+52
-204
lines changed

be/src/vec/functions/function_date_or_datetime_computation.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,6 @@
2121

2222
namespace doris::vectorized {
2323

24-
using FunctionDateDiff = FunctionTimeDiff<DateDiffImpl<TYPE_DATETIME>>;
25-
using FunctionTimeDiffImpl = FunctionTimeDiff<TimeDiffImpl<TYPE_DATETIME>>;
26-
using FunctionYearsDiff = FunctionTimeDiff<YearsDiffImpl<TYPE_DATETIME>>;
27-
using FunctionMonthsDiff = FunctionTimeDiff<MonthsDiffImpl<TYPE_DATETIME>>;
28-
using FunctionDaysDiff = FunctionTimeDiff<DaysDiffImpl<TYPE_DATETIME>>;
29-
using FunctionWeeksDiff = FunctionTimeDiff<WeeksDiffImpl<TYPE_DATETIME>>;
30-
using FunctionHoursDiff = FunctionTimeDiff<HoursDiffImpl<TYPE_DATETIME>>;
31-
using FunctionMinutesDiff = FunctionTimeDiff<MintuesDiffImpl<TYPE_DATETIME>>;
32-
using FunctionSecondsDiff = FunctionTimeDiff<SecondsDiffImpl<TYPE_DATETIME>>;
33-
34-
using FunctionToYearWeekTwoArgs =
35-
FunctionDateOrDateTimeComputation<ToYearWeekTwoArgsImpl<TYPE_DATETIME>>;
36-
using FunctionToWeekTwoArgs = FunctionDateOrDateTimeComputation<ToWeekTwoArgsImpl<TYPE_DATETIME>>;
37-
3824
struct NowFunctionName {
3925
static constexpr auto name = "now";
4026
};
@@ -66,21 +52,7 @@ using FunctionMilliSecToDateTime = TimestampToDateTime<MilliSec>;
6652
using FunctionSecToDateTime = TimestampToDateTime<Sec>;
6753

6854
void register_function_date_time_computation(SimpleFunctionFactory& factory) {
69-
factory.register_function<FunctionDateDiff>();
70-
factory.register_function<FunctionTimeDiffImpl>();
71-
factory.register_function<FunctionYearsDiff>();
72-
factory.register_function<FunctionMonthsDiff>();
73-
factory.register_function<FunctionWeeksDiff>();
74-
factory.register_function<FunctionDaysDiff>();
75-
factory.register_function<FunctionHoursDiff>();
76-
factory.register_function<FunctionMinutesDiff>();
77-
factory.register_function<FunctionSecondsDiff>();
78-
7955
factory.register_function<FunctionNextDay>();
80-
81-
factory.register_function<FunctionToYearWeekTwoArgs>();
82-
factory.register_function<FunctionToWeekTwoArgs>();
83-
8456
factory.register_function<FunctionNow>();
8557
factory.register_function<FunctionNowWithPrecision>();
8658
factory.register_function(CurDateFunctionName::name, &createCurDateFunctionBuilderFunction);

be/src/vec/functions/function_date_or_datetime_to_string.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ class FunctionDateOrDateTimeToString : public IFunction {
113113
}
114114
};
115115

116-
using FunctionDayName = FunctionDateOrDateTimeToString<DayNameImpl<TYPE_DATETIME>>;
117116
using FunctionDayNameV2 = FunctionDateOrDateTimeToString<DayNameImpl<TYPE_DATEV2>>;
118-
using FunctionMonthName = FunctionDateOrDateTimeToString<MonthNameImpl<TYPE_DATETIME>>;
119117
using FunctionMonthNameV2 = FunctionDateOrDateTimeToString<MonthNameImpl<TYPE_DATEV2>>;
120118

121119
using FunctionDateTimeV2DayName = FunctionDateOrDateTimeToString<DayNameImpl<TYPE_DATETIMEV2>>;
@@ -125,8 +123,6 @@ using FunctionDateIso8601 = FunctionDateOrDateTimeToString<ToIso8601Impl<TYPE_DA
125123
using FunctionDateTimeIso8601 = FunctionDateOrDateTimeToString<ToIso8601Impl<TYPE_DATETIMEV2>>;
126124

127125
void register_function_date_time_to_string(SimpleFunctionFactory& factory) {
128-
factory.register_function<FunctionDayName>();
129-
factory.register_function<FunctionMonthName>();
130126
factory.register_function<FunctionDayNameV2>();
131127
factory.register_function<FunctionMonthNameV2>();
132128
factory.register_function<FunctionDateTimeV2DayName>();

be/src/vec/functions/function_datetime_string_to_string.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
namespace doris::vectorized {
2626

27-
using FunctionDateFormat = FunctionDateTimeStringToString<DateFormatImpl<TYPE_DATE>>;
28-
using FunctionDateTimeFormat = FunctionDateTimeStringToString<DateFormatImpl<TYPE_DATETIME>>;
2927
using FunctionDateFormatV2 = FunctionDateTimeStringToString<DateFormatImpl<TYPE_DATEV2>>;
3028
using FunctionDateTimeV2DateFormat =
3129
FunctionDateTimeStringToString<DateFormatImpl<TYPE_DATETIMEV2>>;
@@ -41,8 +39,6 @@ using FunctionFromUnixTimeNewDecimalTwoArg =
4139
FunctionDateTimeStringToString<FromUnixTimeDecimalImpl<true>>;
4240

4341
void register_function_date_time_string_to_string(SimpleFunctionFactory& factory) {
44-
factory.register_function<FunctionDateFormat>();
45-
factory.register_function<FunctionDateTimeFormat>();
4642
factory.register_function<FunctionDateFormatV2>();
4743
factory.register_function<FunctionFromUnixTimeOneArg>();
4844
factory.register_function<FunctionFromUnixTimeTwoArg>();

be/src/vec/functions/time_of_function.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,16 @@
2626

2727
namespace doris::vectorized {
2828

29-
using FunctionWeekOfYear =
30-
FunctionDateOrDateTimeToSomething<DataTypeInt8, WeekOfYearImpl<TYPE_DATETIME>>;
3129
using FunctionWeekOfYearV2 =
3230
FunctionDateOrDateTimeToSomething<DataTypeInt8, WeekOfYearImpl<TYPE_DATEV2>>;
33-
using FunctionDayOfYear =
34-
FunctionDateOrDateTimeToSomething<DataTypeInt16, DayOfYearImpl<TYPE_DATETIME>>;
3531
using FunctionDayOfYearV2 =
3632
FunctionDateOrDateTimeToSomething<DataTypeInt16, DayOfYearImpl<TYPE_DATEV2>>;
37-
using FunctionDayOfWeek =
38-
FunctionDateOrDateTimeToSomething<DataTypeInt8, DayOfWeekImpl<TYPE_DATETIME>>;
3933
using FunctionDayOfWeekV2 =
4034
FunctionDateOrDateTimeToSomething<DataTypeInt8, DayOfWeekImpl<TYPE_DATEV2>>;
41-
using FunctionDayOfMonth =
42-
FunctionDateOrDateTimeToSomething<DataTypeInt8, DayOfMonthImpl<TYPE_DATETIME>>;
4335
using FunctionDayOfMonthV2 =
4436
FunctionDateOrDateTimeToSomething<DataTypeInt8, DayOfMonthImpl<TYPE_DATEV2>>;
45-
using FunctionYearWeek =
46-
FunctionDateOrDateTimeToSomething<DataTypeInt32, ToYearWeekOneArgImpl<TYPE_DATETIME>>;
4737
using FunctionYearWeekV2 =
4838
FunctionDateOrDateTimeToSomething<DataTypeInt32, ToYearWeekOneArgImpl<TYPE_DATEV2>>;
49-
using FunctionWeekDay = FunctionDateOrDateTimeToSomething<DataTypeInt8, WeekDayImpl<TYPE_DATETIME>>;
5039
using FunctionWeekDayV2 = FunctionDateOrDateTimeToSomething<DataTypeInt8, WeekDayImpl<TYPE_DATEV2>>;
5140

5241
using FunctionDateTimeV2WeekOfYear =
@@ -63,12 +52,6 @@ using FunctionDateTimeV2WeekDay =
6352
FunctionDateOrDateTimeToSomething<DataTypeInt8, WeekDayImpl<TYPE_DATETIMEV2>>;
6453

6554
void register_function_time_of_function(SimpleFunctionFactory& factory) {
66-
factory.register_function<FunctionDayOfWeek>();
67-
factory.register_function<FunctionDayOfMonth>();
68-
factory.register_function<FunctionDayOfYear>();
69-
factory.register_function<FunctionWeekOfYear>();
70-
factory.register_function<FunctionYearWeek>();
71-
factory.register_function<FunctionWeekDay>();
7255
factory.register_function<FunctionDayOfWeekV2>();
7356
factory.register_function<FunctionDayOfMonthV2>();
7457
factory.register_function<FunctionDayOfYearV2>();

be/src/vec/functions/to_time_function.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,20 @@
2626

2727
namespace doris::vectorized {
2828

29-
using FunctionYear = FunctionDateOrDateTimeToSomething<DataTypeInt16, ToYearImpl<TYPE_DATETIME>>;
3029
using FunctionYearV2 = FunctionDateOrDateTimeToSomething<DataTypeInt16, ToYearImpl<TYPE_DATEV2>>;
3130
using FunctionYearOfWeek =
3231
FunctionDateOrDateTimeToSomething<DataTypeInt16, ToYearOfWeekImpl<TYPE_DATEV2>>;
33-
using FunctionQuarter =
34-
FunctionDateOrDateTimeToSomething<DataTypeInt8, ToQuarterImpl<TYPE_DATETIME>>;
3532
using FunctionQuarterV2 =
3633
FunctionDateOrDateTimeToSomething<DataTypeInt8, ToQuarterImpl<TYPE_DATEV2>>;
37-
using FunctionMonth = FunctionDateOrDateTimeToSomething<DataTypeInt8, ToMonthImpl<TYPE_DATETIME>>;
3834
using FunctionMonthV2 = FunctionDateOrDateTimeToSomething<DataTypeInt8, ToMonthImpl<TYPE_DATEV2>>;
39-
using FunctionDay = FunctionDateOrDateTimeToSomething<DataTypeInt8, ToDayImpl<TYPE_DATETIME>>;
4035
using FunctionDayV2 = FunctionDateOrDateTimeToSomething<DataTypeInt8, ToDayImpl<TYPE_DATEV2>>;
41-
using FunctionWeek =
42-
FunctionDateOrDateTimeToSomething<DataTypeInt8, ToWeekOneArgImpl<TYPE_DATETIME>>;
4336
using FunctionWeekV2 =
4437
FunctionDateOrDateTimeToSomething<DataTypeInt8, ToWeekOneArgImpl<TYPE_DATEV2>>;
45-
using FunctionHour = FunctionDateOrDateTimeToSomething<DataTypeInt8, ToHourImpl<TYPE_DATETIME>>;
4638
using FunctionHourV2 = FunctionDateOrDateTimeToSomething<DataTypeInt8, ToHourImpl<TYPE_DATEV2>>;
47-
using FunctionMinute = FunctionDateOrDateTimeToSomething<DataTypeInt8, ToMinuteImpl<TYPE_DATETIME>>;
4839
using FunctionMinuteV2 = FunctionDateOrDateTimeToSomething<DataTypeInt8, ToMinuteImpl<TYPE_DATEV2>>;
49-
using FunctionSecond = FunctionDateOrDateTimeToSomething<DataTypeInt8, ToSecondImpl<TYPE_DATETIME>>;
5040
using FunctionSecondV2 = FunctionDateOrDateTimeToSomething<DataTypeInt8, ToSecondImpl<TYPE_DATEV2>>;
51-
using FunctionToDays = FunctionDateOrDateTimeToSomething<DataTypeInt32, ToDaysImpl<TYPE_DATETIME>>;
5241
using FunctionToDaysV2 = FunctionDateOrDateTimeToSomething<DataTypeInt32, ToDaysImpl<TYPE_DATEV2>>;
53-
using FunctionToDate = FunctionDateOrDateTimeToSomething<DataTypeDate, ToDateImpl<TYPE_DATETIME>>;
5442
using FunctionToDateV2 = FunctionDateOrDateTimeToSomething<DataTypeDateV2, ToDateImpl<TYPE_DATEV2>>;
55-
using FunctionDate = FunctionDateOrDateTimeToSomething<DataTypeDate, DateImpl<TYPE_DATETIME>>;
5643
using FunctionDateV2 = FunctionDateOrDateTimeToSomething<DataTypeDateV2, DateImpl<TYPE_DATEV2>>;
5744

5845
using FunctionDateTimeV2Year =
@@ -79,25 +66,10 @@ using FunctionDateTimeV2ToDate =
7966
FunctionDateOrDateTimeToSomething<DataTypeDateV2, ToDateImpl<TYPE_DATETIMEV2>>;
8067
using FunctionDateTimeV2Date =
8168
FunctionDateOrDateTimeToSomething<DataTypeDateV2, DateImpl<TYPE_DATETIMEV2>>;
82-
83-
using FunctionTimeStamp =
84-
FunctionDateOrDateTimeToSomething<DataTypeDateTime, TimeStampImpl<TYPE_DATETIME>>;
8569
using FunctionTimeStampV2 =
8670
FunctionDateOrDateTimeToSomething<DataTypeDateTimeV2, TimeStampImpl<TYPE_DATETIMEV2>>;
8771

8872
void register_function_to_time_function(SimpleFunctionFactory& factory) {
89-
factory.register_function<FunctionSecond>();
90-
factory.register_function<FunctionMinute>();
91-
factory.register_function<FunctionHour>();
92-
factory.register_function<FunctionDay>();
93-
factory.register_function<FunctionWeek>();
94-
factory.register_function<FunctionMonth>();
95-
factory.register_function<FunctionYear>();
96-
factory.register_function<FunctionQuarter>();
97-
factory.register_function<FunctionToDays>();
98-
factory.register_function<FunctionToDate>();
99-
factory.register_function<FunctionDate>();
100-
factory.register_function<FunctionTimeStamp>();
10173
factory.register_function<FunctionTimeStampV2>();
10274
factory.register_function<FunctionSecondV2>();
10375
factory.register_function<FunctionMinuteV2>();

be/test/vec/function/function_time_test.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using namespace ut_type;
3838
TEST(VTimestampFunctionsTest, day_of_week_test) {
3939
std::string func_name = "dayofweek";
4040

41-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
41+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
4242

4343
DataSet data_set = {{{std::string("2001-02-03 12:34:56")}, int8_t {7}}};
4444

@@ -48,7 +48,7 @@ TEST(VTimestampFunctionsTest, day_of_week_test) {
4848
TEST(VTimestampFunctionsTest, day_of_month_test) {
4949
std::string func_name = "dayofmonth";
5050

51-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
51+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
5252

5353
DataSet data_set = {{{std::string("2020-01-01 00:00:00")}, int8_t {1}},
5454
{{std::string("2020-02-29 00:00:00")}, int8_t {29}}};
@@ -59,7 +59,7 @@ TEST(VTimestampFunctionsTest, day_of_month_test) {
5959
TEST(VTimestampFunctionsTest, day_of_year_test) {
6060
std::string func_name = "dayofyear";
6161

62-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
62+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
6363

6464
DataSet data_set = {{{std::string("2020-02-29 00:00:00")}, int16_t {60}}};
6565

@@ -69,7 +69,7 @@ TEST(VTimestampFunctionsTest, day_of_year_test) {
6969
TEST(VTimestampFunctionsTest, week_of_year_test) {
7070
std::string func_name = "weekofyear";
7171

72-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
72+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
7373

7474
DataSet data_set = {{{std::string("2020-02-29 00:00:00")}, int8_t {9}}};
7575

@@ -79,7 +79,7 @@ TEST(VTimestampFunctionsTest, week_of_year_test) {
7979
TEST(VTimestampFunctionsTest, year_test) {
8080
std::string func_name = "year";
8181

82-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
82+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
8383

8484
DataSet data_set = {{{std::string("2021-01-01 00:00:00")}, int16_t {2021}},
8585
{{std::string("2025-05-01 00:00:00")}, int16_t {2025}}};
@@ -90,7 +90,7 @@ TEST(VTimestampFunctionsTest, year_test) {
9090
TEST(VTimestampFunctionsTest, quarter_test) {
9191
std::string func_name = "quarter";
9292

93-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
93+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
9494

9595
DataSet data_set = {{{std::string("2021-01-01 00:00:00")}, int8_t {1}},
9696
{{std::string("2025-10-23 00:00:00")}, int8_t {4}}};
@@ -101,7 +101,7 @@ TEST(VTimestampFunctionsTest, quarter_test) {
101101
TEST(VTimestampFunctionsTest, month_test) {
102102
std::string func_name = "month";
103103

104-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
104+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
105105

106106
DataSet data_set = {{{std::string("2021-01-01 00:00:00")}, int8_t {1}},
107107
{{std::string("2025-05-23 00:00:00")}, int8_t {5}}};
@@ -112,7 +112,7 @@ TEST(VTimestampFunctionsTest, month_test) {
112112
TEST(VTimestampFunctionsTest, day_test) {
113113
std::string func_name = "day";
114114

115-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
115+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
116116

117117
DataSet data_set = {{{std::string("2021-01-01 00:00:00")}, int8_t {1}},
118118
{{std::string("2025-05-23 00:00:00")}, int8_t {23}}};
@@ -123,7 +123,7 @@ TEST(VTimestampFunctionsTest, day_test) {
123123
TEST(VTimestampFunctionsTest, hour_test) {
124124
std::string func_name = "hour";
125125

126-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
126+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
127127

128128
DataSet data_set = {{{std::string("2021-01-01 23:59:59")}, int8_t {23}},
129129
{{std::string("2021-01-13 16:56:00")}, int8_t {16}}};
@@ -134,7 +134,7 @@ TEST(VTimestampFunctionsTest, hour_test) {
134134
TEST(VTimestampFunctionsTest, minute_test) {
135135
std::string func_name = "minute";
136136

137-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
137+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
138138

139139
DataSet data_set = {{{std::string("2021-01-01 23:59:50")}, int8_t {59}},
140140
{{std::string("2021-01-13 16:20:00")}, int8_t {20}}};
@@ -145,7 +145,7 @@ TEST(VTimestampFunctionsTest, minute_test) {
145145
TEST(VTimestampFunctionsTest, second_test) {
146146
std::string func_name = "second";
147147

148-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
148+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
149149

150150
DataSet data_set = {
151151
{{std::string("2021-01-01 23:50:59")}, int8_t {59}},
@@ -234,7 +234,7 @@ TEST(VTimestampFunctionsTest, unix_timestamp_test) {
234234
TEST(VTimestampFunctionsTest, timediff_test) {
235235
std::string func_name = "timediff";
236236

237-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME, PrimitiveType::TYPE_DATETIME};
237+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2, PrimitiveType::TYPE_DATETIMEV2};
238238

239239
DataSet data_set = {
240240
{{std::string("2019-07-18 12:00:00"), std::string("2019-07-18 12:00:00")},
@@ -290,7 +290,7 @@ TEST(VTimestampFunctionsTest, convert_tz_test) {
290290
TEST(VTimestampFunctionsTest, date_format_test) {
291291
std::string func_name = "date_format";
292292

293-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME,
293+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2,
294294
Consted {PrimitiveType::TYPE_VARCHAR}};
295295
{
296296
DataSet data_set = {{{std::string("2009-10-04 22:23:00"), std::string("%W %M %Y")},
@@ -341,7 +341,7 @@ TEST(VTimestampFunctionsTest, date_format_test) {
341341
TEST(VTimestampFunctionsTest, to_days_test) {
342342
std::string func_name = "to_days";
343343

344-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
344+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
345345

346346
DataSet data_set = {
347347
{{std::string("2021-01-01 00:00:00")}, 738156},
@@ -353,19 +353,19 @@ TEST(VTimestampFunctionsTest, to_days_test) {
353353
TEST(VTimestampFunctionsTest, date_test) {
354354
std::string func_name = "date";
355355

356-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
356+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
357357

358358
DataSet data_set = {
359359
{{std::string("2021-01-01 06:00:00")}, std::string("2021-01-01")},
360360
};
361361

362-
static_cast<void>(check_function<DataTypeDate, true>(func_name, input_types, data_set));
362+
static_cast<void>(check_function<DataTypeDateV2, true>(func_name, input_types, data_set));
363363
}
364364

365365
TEST(VTimestampFunctionsTest, week_test) {
366366
std::string func_name = "week";
367367

368-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
368+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
369369

370370
DataSet data_set = {{{std::string("1989-03-21 06:00:00")}, int8_t {12}},
371371
{{std::string("9999-12-12 00:00:00")}, int8_t {50}}};
@@ -376,7 +376,7 @@ TEST(VTimestampFunctionsTest, week_test) {
376376
TEST(VTimestampFunctionsTest, yearweek_test) {
377377
std::string func_name = "yearweek";
378378

379-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
379+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
380380

381381
DataSet data_set = {{{std::string("1989-03-21 06:00:00")}, 198912},
382382
{{std::string("9999-12-12 00:00:00")}, 999950}};
@@ -402,7 +402,7 @@ TEST(VTimestampFunctionsTest, weekday_test) {
402402
std::string func_name = "weekday";
403403

404404
{
405-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
405+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
406406

407407
DataSet data_set = {
408408
{{std::string("2001-02-03 12:34:56")}, int8_t {5}},
@@ -1233,7 +1233,7 @@ TEST(VTimestampFunctionsTest, dayname_test) {
12331233
}
12341234

12351235
{
1236-
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIME};
1236+
InputTypeSet input_types = {PrimitiveType::TYPE_DATETIMEV2};
12371237

12381238
DataSet data_set = {
12391239
{{std::string("2007-02-03 00:00:00")}, std::string("Saturday")},

fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/Date.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
import org.apache.doris.nereids.trees.expressions.functions.PropagateNullable;
2626
import org.apache.doris.nereids.trees.expressions.shape.UnaryExpression;
2727
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
28-
import org.apache.doris.nereids.types.DateTimeType;
2928
import org.apache.doris.nereids.types.DateTimeV2Type;
30-
import org.apache.doris.nereids.types.DateType;
3129
import org.apache.doris.nereids.types.DateV2Type;
3230

3331
import com.google.common.base.Preconditions;
@@ -42,8 +40,7 @@ public class Date extends ScalarFunction
4240
implements UnaryExpression, ExplicitlyCastableSignature, PropagateNullable, PropagateNullLiteral, Monotonic {
4341

4442
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
45-
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT),
46-
FunctionSignature.ret(DateType.INSTANCE).args(DateTimeType.INSTANCE)
43+
FunctionSignature.ret(DateV2Type.INSTANCE).args(DateTimeV2Type.SYSTEM_DEFAULT)
4744
);
4845

4946
/**

fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/DateDiff.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.apache.doris.nereids.trees.expressions.functions.PropagateNullableOnDateOrTimeLikeV2Args;
2424
import org.apache.doris.nereids.trees.expressions.shape.BinaryExpression;
2525
import org.apache.doris.nereids.trees.expressions.visitor.ExpressionVisitor;
26-
import org.apache.doris.nereids.types.DateTimeType;
2726
import org.apache.doris.nereids.types.DateTimeV2Type;
2827
import org.apache.doris.nereids.types.DateV2Type;
2928
import org.apache.doris.nereids.types.IntegerType;
@@ -42,8 +41,7 @@ public class DateDiff extends ScalarFunction
4241
public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
4342
FunctionSignature.ret(IntegerType.INSTANCE)
4443
.args(DateTimeV2Type.SYSTEM_DEFAULT, DateTimeV2Type.SYSTEM_DEFAULT),
45-
FunctionSignature.ret(IntegerType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE),
46-
FunctionSignature.ret(IntegerType.INSTANCE).args(DateTimeType.INSTANCE, DateTimeType.INSTANCE)
44+
FunctionSignature.ret(IntegerType.INSTANCE).args(DateV2Type.INSTANCE, DateV2Type.INSTANCE)
4745
);
4846

4947
/**

0 commit comments

Comments
 (0)