From 823088a9eb72e3f74159698628d0c24cabed1609 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 26 Jul 2022 17:48:57 +0800 Subject: [PATCH] [FOLLOW-UP] (datetimev2) complete date function ut and built-in function declaration (#11154) --- .../function_date_or_datetime_computation.cpp | 16 +- .../function_date_or_datetime_computation.h | 4 + be/src/vec/functions/to_time_function.cpp | 25 +- be/src/vec/runtime/vdatetime_value.cpp | 170 ++- be/src/vec/runtime/vdatetime_value.h | 12 +- be/test/vec/function/function_test_util.cpp | 16 +- be/test/vec/function/function_test_util.h | 3 + be/test/vec/function/function_time_test.cpp | 1007 ++++++++++++++--- gensrc/script/doris_builtins_functions.py | 880 ++++++++++++++ 9 files changed, 1940 insertions(+), 193 deletions(-) diff --git a/be/src/vec/functions/function_date_or_datetime_computation.cpp b/be/src/vec/functions/function_date_or_datetime_computation.cpp index 11f16b49dc..a668107690 100644 --- a/be/src/vec/functions/function_date_or_datetime_computation.cpp +++ b/be/src/vec/functions/function_date_or_datetime_computation.cpp @@ -23,8 +23,8 @@ namespace doris::vectorized { using FunctionAddSeconds = FunctionDateOrDateTimeComputation< AddSecondsImpl>; -using FunctionAddSecondsV2 = - FunctionDateOrDateTimeComputation>; +using FunctionAddSecondsV2 = FunctionDateOrDateTimeComputation< + AddSecondsImpl>; using FunctionAddMinutes = FunctionDateOrDateTimeComputation< AddMinutesImpl>; using FunctionAddHours = @@ -35,10 +35,10 @@ using FunctionAddWeeks = FunctionDateOrDateTimeComputation>; using FunctionAddMonths = FunctionDateOrDateTimeComputation>; -using FunctionAddMinutesV2 = - FunctionDateOrDateTimeComputation>; +using FunctionAddMinutesV2 = FunctionDateOrDateTimeComputation< + AddMinutesImpl>; using FunctionAddHoursV2 = - FunctionDateOrDateTimeComputation>; + FunctionDateOrDateTimeComputation>; using FunctionAddDaysV2 = FunctionDateOrDateTimeComputation>; using FunctionAddWeeksV2 = @@ -71,11 +71,11 @@ using FunctionSubQuarters = FunctionDateOrDateTimeComputation< using FunctionSubYears = FunctionDateOrDateTimeComputation< SubtractYearsImpl>; using FunctionSubSecondsV2 = FunctionDateOrDateTimeComputation< - SubtractSecondsImpl>; + SubtractSecondsImpl>; using FunctionSubMinutesV2 = FunctionDateOrDateTimeComputation< - SubtractMinutesImpl>; + SubtractMinutesImpl>; using FunctionSubHoursV2 = FunctionDateOrDateTimeComputation< - SubtractHoursImpl>; + SubtractHoursImpl>; using FunctionSubDaysV2 = FunctionDateOrDateTimeComputation>; using FunctionSubWeeksV2 = FunctionDateOrDateTimeComputation< diff --git a/be/src/vec/functions/function_date_or_datetime_computation.h b/be/src/vec/functions/function_date_or_datetime_computation.h index ad03133b31..8915a8dfaf 100644 --- a/be/src/vec/functions/function_date_or_datetime_computation.h +++ b/be/src/vec/functions/function_date_or_datetime_computation.h @@ -382,6 +382,10 @@ struct DateTimeAddIntervalImpl { Op::vector_constant(sources->get_data(), col_to->get_data(), null_map->get_data(), delta_const_column->get_field().get()); + } else if (delta_const_column->get_field().get_type() == Field::Types::UInt64) { + Op::vector_constant(sources->get_data(), col_to->get_data(), + null_map->get_data(), + delta_const_column->get_field().get()); } else { Op::vector_constant(sources->get_data(), col_to->get_data(), null_map->get_data(), diff --git a/be/src/vec/functions/to_time_function.cpp b/be/src/vec/functions/to_time_function.cpp index b370dc19a7..480cb0d720 100644 --- a/be/src/vec/functions/to_time_function.cpp +++ b/be/src/vec/functions/to_time_function.cpp @@ -81,37 +81,36 @@ using FunctionDateV2 = using FunctionDateTimeV2Year = FunctionDateOrDateTimeToSomething, UInt32>>; + ToYearImpl, UInt64>>; using FunctionDateTimeV2Quarter = FunctionDateOrDateTimeToSomething, UInt32>>; + ToQuarterImpl, UInt64>>; using FunctionDateTimeV2Month = FunctionDateOrDateTimeToSomething, UInt32>>; + ToMonthImpl, UInt64>>; using FunctionDateTimeV2Day = FunctionDateOrDateTimeToSomething, UInt32>>; -using FunctionDateTimeV2Week = - FunctionDateOrDateTimeToSomething, UInt32>>; + ToDayImpl, UInt64>>; +using FunctionDateTimeV2Week = FunctionDateOrDateTimeToSomething< + DataTypeInt32, ToWeekOneArgImpl, UInt64>>; using FunctionDateTimeV2Hour = FunctionDateOrDateTimeToSomething, UInt32>>; + ToHourImpl, UInt64>>; using FunctionDateTimeV2Minute = FunctionDateOrDateTimeToSomething, UInt32>>; + ToMinuteImpl, UInt64>>; using FunctionDateTimeV2Second = FunctionDateOrDateTimeToSomething, UInt32>>; + ToSecondImpl, UInt64>>; using FunctionDateTimeV2ToDays = FunctionDateOrDateTimeToSomething, UInt32>>; + ToDaysImpl, UInt64>>; using FunctionDateTimeV2ToDate = FunctionDateOrDateTimeToSomething, UInt32>>; + ToDateImpl, UInt64>>; using FunctionDateTimeV2Date = FunctionDateOrDateTimeToSomething, UInt32>>; + DateImpl, UInt64>>; using FunctionTimeStamp = FunctionDateOrDateTimeToSomething>; diff --git a/be/src/vec/runtime/vdatetime_value.cpp b/be/src/vec/runtime/vdatetime_value.cpp index 880ca20449..a48661b6d5 100644 --- a/be/src/vec/runtime/vdatetime_value.cpp +++ b/be/src/vec/runtime/vdatetime_value.cpp @@ -1669,6 +1669,9 @@ std::size_t hash_value(VecDateTimeValue const& value) { template bool DateV2Value::is_invalid(uint32_t year, uint32_t month, uint32_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t microsecond) { + if (hour > 24 || minute >= 60 || second >= 60 || microsecond > 999999) { + return true; + } if (month == 2 && day == 29 && doris::is_leap(year)) return false; if (year < MIN_YEAR || year > MAX_YEAR || month == 0 || month > 12 || day > s_days_in_month[month] || day == 0) { @@ -2193,9 +2196,15 @@ bool DateV2Value::from_date_format_str(const char* format, int format_len, co // 3. if both are true, means all part of date_time be set, no need check_range_and_set_time bool already_set_date_part = yearday > 0 || (week_num >= 0 && weekday > 0); if (already_set_date_part && already_set_time_part) return true; - if (already_set_date_part) - return check_range_and_set_time(date_v2_value_.year_, date_v2_value_.month_, - date_v2_value_.day_, hour, minute, second, microsecond); + if (already_set_date_part) { + if constexpr (is_datetime) { + return check_range_and_set_time(date_v2_value_.year_, date_v2_value_.month_, + date_v2_value_.day_, hour, minute, second, microsecond); + } else { + return check_range_and_set_time(date_v2_value_.year_, date_v2_value_.month_, + date_v2_value_.day_, 0, 0, 0, 0); + } + } if (already_set_time_part) { if constexpr (is_datetime) { return check_range_and_set_time(year, month, day, date_v2_value_.hour_, @@ -2205,7 +2214,11 @@ bool DateV2Value::from_date_format_str(const char* format, int format_len, co return check_range_and_set_time(year, month, day, 0, 0, 0, 0); } } - return check_range_and_set_time(year, month, day, hour, minute, second, microsecond); + if constexpr (is_datetime) { + return check_range_and_set_time(year, month, day, hour, minute, second, microsecond); + } else { + return check_range_and_set_time(year, month, day, 0, 0, 0, 0); + } } template @@ -2360,10 +2373,11 @@ bool DateV2Value::get_date_from_daynr(uint64_t daynr) { } day = days_of_year + leap_day; - if (is_invalid(year, month, day, 0, 0, 0, 0)) { + if (is_invalid(year, month, day, this->hour(), this->minute(), this->second(), + this->microsecond())) { return false; } - set_time(year, month, day, 0, 0, 0, 0); + set_time(year, month, day, this->hour(), this->minute(), this->second(), this->microsecond()); return true; } @@ -2372,15 +2386,30 @@ template bool DateV2Value::date_add_interval(const TimeInterval& interval, DateV2Value& to_value) { if (!is_valid_date()) return false; + int sign = interval.is_neg ? -1 : 1; + if constexpr ((unit == SECOND) || (unit == MINUTE) || (unit == HOUR) || (unit == SECOND_MICROSECOND) || (unit == MINUTE_MICROSECOND) || (unit == MINUTE_SECOND) || (unit == HOUR_MICROSECOND) || (unit == HOUR_SECOND) || (unit == HOUR_MINUTE) || (unit == DAY_MICROSECOND) || (unit == DAY_SECOND) || (unit == DAY_MINUTE) || (unit == DAY_HOUR) || (unit == DAY) || (unit == WEEK)) { - uint32_t day_nr = daynr() + interval.day; + // This may change the day information + + int64_t seconds = (this->day() - 1) * 86400L + this->hour() * 3600L + this->minute() * 60 + + this->second() + + sign * (interval.day * 86400 + interval.hour * 3600 + + interval.minute * 60 + interval.second); + int64_t days = seconds / 86400; + seconds %= 86400L; + if (seconds < 0) { + seconds += 86400L; + days--; + } + int64_t day_nr = doris::calc_daynr(this->year(), this->month(), 1) + days; if (!to_value.get_date_from_daynr(day_nr)) { return false; } + to_value.set_time(seconds / 3600, (seconds / 60) % 60, seconds % 60, 0); } else if constexpr (unit == YEAR) { // This only change year information to_value.template set_time_unit(date_v2_value_.year_ + interval.year); @@ -2410,6 +2439,66 @@ bool DateV2Value::date_add_interval(const TimeInterval& interval, DateV2Value return true; } +template +template +bool DateV2Value::date_add_interval(const TimeInterval& interval) { + if (!is_valid_date()) return false; + + int sign = interval.is_neg ? -1 : 1; + + if constexpr ((unit == SECOND) || (unit == MINUTE) || (unit == HOUR) || + (unit == SECOND_MICROSECOND) || (unit == MINUTE_MICROSECOND) || + (unit == MINUTE_SECOND) || (unit == HOUR_MICROSECOND) || (unit == HOUR_SECOND) || + (unit == HOUR_MINUTE) || (unit == DAY_MICROSECOND) || (unit == DAY_SECOND) || + (unit == DAY_MINUTE) || (unit == DAY_HOUR) || (unit == DAY) || (unit == WEEK)) { + // This may change the day information + + int64_t seconds = (this->day() - 1) * 86400L + this->hour() * 3600L + this->minute() * 60 + + this->second() + + sign * (interval.day * 86400 + interval.hour * 3600 + + interval.minute * 60 + interval.second); + int64_t days = seconds / 86400; + seconds %= 86400L; + if (seconds < 0) { + seconds += 86400L; + days--; + } + int64_t day_nr = doris::calc_daynr(this->year(), this->month(), 1) + days; + if (!this->get_date_from_daynr(day_nr)) { + return false; + } + if constexpr (is_datetime) { + this->set_time(seconds / 3600, (seconds / 60) % 60, seconds % 60, this->microsecond()); + } + } else if constexpr (unit == YEAR) { + // This only change year information + this->template set_time_unit(date_v2_value_.year_ + interval.year); + if (this->year() > 9999) { + return false; + } + if (date_v2_value_.month_ == 2 && date_v2_value_.day_ == 29 && + !doris::is_leap(this->year())) { + this->template set_time_unit(28); + } + } else if constexpr (unit == QUARTER || unit == MONTH || unit == YEAR_MONTH) { + // This will change month and year information, maybe date. + int64_t months = date_v2_value_.year_ * 12 + date_v2_value_.month_ - 1 + + 12 * interval.year + interval.month; + this->template set_time_unit(months / 12); + if (this->year() > 9999) { + return false; + } + this->template set_time_unit((months % 12) + 1); + if (date_v2_value_.day_ > s_days_in_month[this->month()]) { + date_v2_value_.day_ = s_days_in_month[this->month()]; + if (this->month() == 2 && doris::is_leap(this->year())) { + this->template set_time_unit(date_v2_value_.day_ + 1); + } + } + } + return true; +} + template bool DateV2Value::unix_timestamp(int64_t* timestamp, const std::string& timezone) const { cctz::time_zone ctz; @@ -2581,7 +2670,7 @@ bool DateV2Value::to_format_string(const char* format, int len, char* to) con case 'h': case 'I': // Hour (01..12) - pos = int_to_str(12, buf); + int_to_str((this->hour() % 24 + 11) % 12 + 1, buf); to = append_with_prefix(buf, pos - buf, '0', 2, to); break; case 'H': @@ -2627,9 +2716,21 @@ bool DateV2Value::to_format_string(const char* format, int len, char* to) con break; case 'r': { // Time, 12-hour (hh:mm:ss followed by AM or PM) - std::string time12_str("12:00:00 AM"); - memcpy(to, time12_str.data(), time12_str.size()); - to += time12_str.size(); + *to++ = (char)('0' + (((this->hour() + 11) % 12 + 1) / 10)); + *to++ = (char)('0' + (((this->hour() + 11) % 12 + 1) % 10)); + *to++ = ':'; + // Minute + *to++ = (char)('0' + (this->minute() / 10)); + *to++ = (char)('0' + (this->minute() % 10)); + *to++ = ':'; + /* Second */ + *to++ = (char)('0' + (this->second() / 10)); + *to++ = (char)('0' + (this->second() % 10)); + if ((this->hour() % 24) >= 12) { + to = append_string(" PM", to); + } else { + to = append_string(" AM", to); + } break; } case 's': @@ -2640,9 +2741,16 @@ bool DateV2Value::to_format_string(const char* format, int len, char* to) con break; case 'T': { // Time, 24-hour (hh:mm:ss) - std::string time24_str("00:00:00"); - memcpy(to, time24_str.data(), time24_str.size()); - to += time24_str.size(); + *to++ = (char)('0' + ((this->hour() % 24) / 10)); + *to++ = (char)('0' + ((this->hour() % 24) % 10)); + *to++ = ':'; + // Minute + *to++ = (char)('0' + (this->minute() / 10)); + *to++ = (char)('0' + (this->minute() % 10)); + *to++ = ':'; + /* Second */ + *to++ = (char)('0' + (this->second() / 10)); + *to++ = (char)('0' + (this->second() % 10)); break; } case 'u': @@ -2966,4 +3074,38 @@ template bool VecDateTimeValue::date_add_interval(const TimeInte template bool VecDateTimeValue::date_add_interval(const TimeInterval& interval); template bool VecDateTimeValue::date_add_interval(const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); + +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); +template bool DateV2Value::date_add_interval( + const TimeInterval& interval); + } // namespace doris::vectorized diff --git a/be/src/vec/runtime/vdatetime_value.h b/be/src/vec/runtime/vdatetime_value.h index 350b8b7373..7cf696b8c7 100644 --- a/be/src/vec/runtime/vdatetime_value.h +++ b/be/src/vec/runtime/vdatetime_value.h @@ -829,7 +829,7 @@ public: return calc_daynr(date_v2_value_.year_, date_v2_value_.month_, date_v2_value_.day_); } - int hour() const { + uint8_t hour() const { if constexpr (is_datetime) { return date_v2_value_.hour_; } else { @@ -837,7 +837,7 @@ public: } } - int minute() const { + uint8_t minute() const { if constexpr (is_datetime) { return date_v2_value_.minute_; } else { @@ -845,7 +845,7 @@ public: } } - int second() const { + uint8_t second() const { if constexpr (is_datetime) { return date_v2_value_.second_; } else { @@ -853,7 +853,7 @@ public: } } - int microsecond() const { + uint32_t microsecond() const { if constexpr (is_datetime) { return date_v2_value_.microsecond_; } else { @@ -912,9 +912,7 @@ public: bool date_add_interval(const TimeInterval& interval, DateV2Value& to_value); template - bool date_add_interval(const TimeInterval& interval) { - return this->date_add_interval(interval, *this); - } + bool date_add_interval(const TimeInterval& interval); //unix_timestamp is called with a timezone argument, //it returns seconds of the value of date literal since '1970-01-01 00:00:00' UTC diff --git a/be/test/vec/function/function_test_util.cpp b/be/test/vec/function/function_test_util.cpp index 956a76e4ff..3cc25ccd95 100644 --- a/be/test/vec/function/function_test_util.cpp +++ b/be/test/vec/function/function_test_util.cpp @@ -40,6 +40,13 @@ uint32_t str_to_date_v2(std::string datetime_str, std::string datetime_format) { return binary_cast, UInt32>(v); } +uint64_t str_to_datetime_v2(std::string datetime_str, std::string datetime_format) { + DateV2Value v; + v.from_date_format_str(datetime_format.c_str(), datetime_format.size(), datetime_str.c_str(), + datetime_str.size()); + return binary_cast, UInt64>(v); +} + size_t type_index_to_data_type(const std::vector& input_types, size_t index, ut_type::UTDataTypeDesc& ut_desc, DataTypePtr& type) { doris_udf::FunctionContext::TypeDesc& desc = ut_desc.type_desc; @@ -109,7 +116,7 @@ size_t type_index_to_data_type(const std::vector& input_types, size_t return 1; case TypeIndex::DateTimeV2: desc.type = doris_udf::FunctionContext::TYPE_DATETIMEV2; - type = std::make_shared(); + type = std::make_shared(); return 1; case TypeIndex::Array: { desc.type = doris_udf::FunctionContext::TYPE_ARRAY; @@ -220,6 +227,13 @@ bool insert_cell(MutableColumnPtr& column, DataTypePtr type_ptr, const std::any& v.from_date_format_str(date_time_format.c_str(), date_time_format.size(), datetime_str.c_str(), datetime_str.size()); column->insert_data(reinterpret_cast(&v), 0); + } else if (type.is_date_time_v2()) { + static std::string date_time_format("%Y-%m-%d %H:%i:%s.%f"); + auto datetime_str = std::any_cast(cell); + DateV2Value v; + v.from_date_format_str(date_time_format.c_str(), date_time_format.size(), + datetime_str.c_str(), datetime_str.size()); + column->insert_data(reinterpret_cast(&v), 0); } else if (type.is_array()) { auto v = std::any_cast(cell); column->insert(v); diff --git a/be/test/vec/function/function_test_util.h b/be/test/vec/function/function_test_util.h index f29ab896c3..4e0685ec91 100644 --- a/be/test/vec/function/function_test_util.h +++ b/be/test/vec/function/function_test_util.h @@ -46,6 +46,7 @@ using InputTypeSet = std::vector; int64_t str_to_date_time(std::string datetime_str, bool data_time = true); uint32_t str_to_date_v2(std::string datetime_str, std::string datetime_format); +uint64_t str_to_datetime_v2(std::string datetime_str, std::string datetime_format); namespace ut_type { using TINYINT = int8_t; @@ -223,6 +224,8 @@ void check_function(const std::string& func_name, const InputTypeSet& input_type fn_ctx_return.type = doris_udf::FunctionContext::TYPE_DATETIME; } else if (std::is_same_v) { fn_ctx_return.type = doris_udf::FunctionContext::TYPE_DATEV2; + } else if (std::is_same_v) { + fn_ctx_return.type = doris_udf::FunctionContext::TYPE_DATETIMEV2; } else { fn_ctx_return.type = doris_udf::FunctionContext::INVALID_TYPE; } diff --git a/be/test/vec/function/function_time_test.cpp b/be/test/vec/function/function_time_test.cpp index c03a572435..40bcd4fb5f 100644 --- a/be/test/vec/function/function_time_test.cpp +++ b/be/test/vec/function/function_time_test.cpp @@ -568,139 +568,274 @@ TEST(VTimestampFunctionsTest, weekday_test) { TEST(VTimestampFunctionsTest, day_of_week_v2_test) { std::string func_name = "dayofweek"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2001-02-03")}, 7}, - {{std::string("2020-00-01")}, Null()}, - {{std::string("2020-01-00")}, Null()}}; + DataSet data_set = {{{std::string("2001-02-03")}, 7}, + {{std::string("2020-00-01")}, Null()}, + {{std::string("2020-01-00")}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2001-02-03 01:00:00")}, 7}, + {{std::string("2001-02-03 01:00:00.213")}, 7}, + {{std::string("2001-02-03 01:00:00.123213")}, 7}, + {{std::string("2001-02-03 01:00:00.123123213")}, 7}, + {{std::string("2001-02-03 25:00:00.123123213")}, Null()}, + {{std::string("2001-02-03 01:61:00.123123213")}, Null()}, + {{std::string("2001-02-03 01:00:61.123123213")}, Null()}, + {{std::string("2020-00-01 01:00:00")}, Null()}, + {{std::string("2020-01-00 01:00:00")}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, day_of_month_v2_test) { std::string func_name = "dayofmonth"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2020-00-01")}, Null()}, - {{std::string("2020-01-01")}, 1}, - {{std::string("2020-02-29")}, 29}}; + DataSet data_set = {{{std::string("2020-00-01")}, Null()}, + {{std::string("2020-01-01")}, 1}, + {{std::string("2020-02-29")}, 29}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2020-00-01 01:00:00")}, Null()}, + {{std::string("2020-01-01 01:00:00")}, 1}, + {{std::string("2020-02-29 01:00:00.123123")}, 29}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, day_of_year_v2_test) { std::string func_name = "dayofyear"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2020-00-01")}, Null()}, - {{std::string("2020-01-00")}, Null()}, - {{std::string("2020-02-29")}, 60}}; + DataSet data_set = {{{std::string("2020-00-01")}, Null()}, + {{std::string("2020-01-00")}, Null()}, + {{std::string("2020-02-29")}, 60}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2020-00-01 01:00:00")}, Null()}, + {{std::string("2020-01-00 01:00:00")}, Null()}, + {{std::string("2020-02-29 01:00:00.1232")}, 60}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, week_of_year_v2_test) { std::string func_name = "weekofyear"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2020-00-01")}, Null()}, - {{std::string("2020-01-00")}, Null()}, - {{std::string("2020-02-29")}, 9}}; + DataSet data_set = {{{std::string("2020-00-01")}, Null()}, + {{std::string("2020-01-00")}, Null()}, + {{std::string("2020-02-29")}, 9}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2020-00-01 01:00:00")}, Null()}, + {{std::string("2020-01-00 01:00:00")}, Null()}, + {{std::string("2020-02-29 01:00:00")}, 9}, + {{std::string("2020-02-29 01:00:00.12312")}, 9}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, year_v2_test) { std::string func_name = "year"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2021-01-01")}, 2021}, - {{std::string("2021-01-00")}, Null()}, - {{std::string("2025-05-01")}, 2025}}; + DataSet data_set = {{{std::string("2021-01-01")}, 2021}, + {{std::string("2021-01-00")}, Null()}, + {{std::string("2025-05-01")}, 2025}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2021-01-01 01:00:00")}, 2021}, + {{std::string("2021-01-00 01:00:00")}, Null()}, + {{std::string("2025-05-01 01:00:00.123")}, 2025}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, quarter_v2_test) { std::string func_name = "quarter"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2021-01-01")}, 1}, - {{std::string("")}, Null()}, - {{std::string("2021-01-32")}, Null()}, - {{std::string("2025-10-23")}, 4}}; + DataSet data_set = {{{std::string("2021-01-01")}, 1}, + {{std::string("")}, Null()}, + {{std::string("2021-01-32")}, Null()}, + {{std::string("2025-10-23")}, 4}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2021-01-01 00:00:00")}, 1}, + {{std::string("")}, Null()}, + {{std::string("2021-01-32 00:00:00")}, Null()}, + {{std::string("2025-10-23 00:00:00")}, 4}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, month_v2_test) { std::string func_name = "month"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2021-01-01")}, 1}, - {{std::string("")}, Null()}, - {{std::string("2021-01-32")}, Null()}, - {{std::string("2025-05-23")}, 5}}; + DataSet data_set = {{{std::string("2021-01-01")}, 1}, + {{std::string("")}, Null()}, + {{std::string("2021-01-32")}, Null()}, + {{std::string("2025-05-23")}, 5}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2021-01-01 00:00:00")}, 1}, + {{std::string("")}, Null()}, + {{std::string("2021-01-32 00:00:00")}, Null()}, + {{std::string("2025-05-23 00:00:00")}, 5}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, day_v2_test) { std::string func_name = "day"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2021-01-01")}, 1}, - {{std::string("")}, Null()}, - {{std::string("2021-01-32")}, Null()}, - {{std::string("2025-05-23")}, 23}}; + DataSet data_set = {{{std::string("2021-01-01")}, 1}, + {{std::string("")}, Null()}, + {{std::string("2021-01-32")}, Null()}, + {{std::string("2025-05-23")}, 23}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2021-01-01 00:00:00")}, 1}, + {{std::string("")}, Null()}, + {{std::string("2021-01-32 00:00:00")}, Null()}, + {{std::string("2025-05-23 00:00:00")}, 23}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, hour_v2_test) { std::string func_name = "hour"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2021-01-01")}, 0}, - {{std::string("2021-01-13")}, 0}, - {{std::string("")}, Null()}, - {{std::string("2025-05-23")}, 0}}; + DataSet data_set = {{{std::string("2021-01-01")}, 0}, + {{std::string("2021-01-13")}, 0}, + {{std::string("")}, Null()}, + {{std::string("2025-05-23")}, 0}}; + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; - check_function(func_name, input_types, data_set); + DataSet data_set = {{{std::string("2021-01-01 00:00:00.123")}, 0}, + {{std::string("2021-01-13 01:00:00.123")}, 1}, + {{std::string("")}, Null()}, + {{std::string("2025-05-23 23:00:00.123")}, 23}, + {{std::string("2025-05-23 25:00:00.123")}, Null()}}; + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, minute_v2_test) { std::string func_name = "minute"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2021-01-01")}, 0}, - {{std::string("2021-01-13")}, 0}, - {{std::string("")}, Null()}, - {{std::string("2025-05-23")}, 0}}; + DataSet data_set = {{{std::string("2021-01-01")}, 0}, + {{std::string("2021-01-13")}, 0}, + {{std::string("")}, Null()}, + {{std::string("2025-05-23")}, 0}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2021-01-01 00:00:00.123")}, 0}, + {{std::string("2021-01-13 00:11:00.123")}, 11}, + {{std::string("")}, Null()}, + {{std::string("2025-05-23 00:22:22.123")}, 22}, + {{std::string("2025-05-23 00:60:22.123")}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, second_v2_test) { std::string func_name = "second"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2021-01-01")}, 0}, - {{std::string("2021-01-13")}, 0}, - {{std::string("")}, Null()}, - {{std::string("2025-05-23")}, 0}}; + DataSet data_set = {{{std::string("2021-01-01")}, 0}, + {{std::string("2021-01-13")}, 0}, + {{std::string("")}, Null()}, + {{std::string("2025-05-23")}, 0}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2021-01-01 00:00:01.123")}, 1}, + {{std::string("2021-01-13 00:00:02.123")}, 2}, + {{std::string("")}, Null()}, + {{std::string("2025-05-23 00:00:63.123")}, Null()}, + {{std::string("2025-05-23 00:00:00.123")}, 0}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, timediff_v2_test) { @@ -762,6 +897,68 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) { check_function(func_name, input_types, data_set); } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::DateTimeV2}; + + DataSet data_set = { + {{std::string("2019-07-18 00:00:00"), std::string("2019-07-18 00:00:00")}, 0.0}, + {{std::string("2019-07-18 00:00:10"), std::string("2019-07-18 00:00:00")}, 10.0}, + {{std::string("2019-00-18 00:00:00"), std::string("2019-07-18 00:00:00")}, Null()}, + {{std::string("2019-07-18 00:00:00"), std::string("2019-07-00 00:00:00")}, Null()}}; + + check_function(func_name, input_types, data_set); + } + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Date}; + + DataSet data_set = { + {{std::string("2019-07-18 00:00:00"), std::string("2019-07-18")}, 0.0}, + {{std::string("2019-07-18 00:00:10"), std::string("2019-07-18")}, 10.0}, + {{std::string("2019-00-18 00:00:00"), std::string("2019-07-18")}, Null()}, + {{std::string("2019-07-18 00:00:00"), std::string("2019-07-00")}, Null()}}; + + check_function(func_name, input_types, data_set); + } + + { + InputTypeSet input_types = {TypeIndex::Date, TypeIndex::DateTimeV2}; + + DataSet data_set = { + {{std::string("2019-07-18"), std::string("2019-07-18 00:00:00")}, 0.0}, + {{std::string("2019-07-18"), std::string("2019-07-18 00:00:10")}, -10.0}, + {{std::string("2019-00-18"), std::string("2019-07-18 00:00:00")}, Null()}, + {{std::string("2019-07-18"), std::string("2019-07-00 00:00:00")}, Null()}}; + + check_function(func_name, input_types, data_set); + } + + { + InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::DateTimeV2}; + + DataSet data_set = { + {{std::string("2019-07-18 00:00:00"), std::string("2019-07-18 00:00:00")}, 0.0}, + {{std::string("2019-07-18 00:00:00"), std::string("2019-07-18 00:00:10")}, -10.0}, + {{std::string("2019-00-18 00:00:00"), std::string("2019-07-18 00:00:00")}, Null()}, + {{std::string("2019-07-18 00:00:00"), std::string("2019-07-00 00:00:00")}, Null()}}; + + check_function(func_name, input_types, data_set); + } + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::DateTime}; + + DataSet data_set = { + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-18 00:00:00")}, 0.0}, + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-18 00:00:00")}, + -0.0}, + {{std::string("2019-00-18 00:00:00.123"), std::string("2019-07-18 00:00:00")}, + Null()}, + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-00 00:00:00")}, + Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, datediff_v2_test) { @@ -823,25 +1020,133 @@ TEST(VTimestampFunctionsTest, datediff_v2_test) { check_function(func_name, input_types, data_set); } + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::DateV2}; + + DataSet data_set = { + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-19")}, -1}, + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-17")}, 1}, + {{std::string("2019-00-18 00:00:00.123"), std::string("2019-07-18")}, Null()}, + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-00")}, Null()}}; + + check_function(func_name, input_types, data_set); + } + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Date}; + + DataSet data_set = { + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-19")}, -1}, + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-17")}, 1}, + {{std::string("2019-00-18 00:00:00.123"), std::string("2019-07-18")}, Null()}, + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-00")}, Null()}}; + + check_function(func_name, input_types, data_set); + } + + { + InputTypeSet input_types = {TypeIndex::Date, TypeIndex::DateTimeV2}; + + DataSet data_set = { + {{std::string("2019-07-18"), std::string("2019-07-19 00:00:00.123")}, -1}, + {{std::string("2019-07-18"), std::string("2019-07-17 00:00:00.123")}, 1}, + {{std::string("2019-00-18"), std::string("2019-07-18 00:00:00.123")}, Null()}, + {{std::string("2019-07-18"), std::string("2019-07-00 00:00:00.123")}, Null()}}; + + check_function(func_name, input_types, data_set); + } + + { + InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::DateTimeV2}; + + DataSet data_set = { + {{std::string("2019-07-18 00:00:00"), std::string("2019-07-19 00:00:00.123")}, -1}, + {{std::string("2019-07-18 00:00:00"), std::string("2019-07-17 00:00:00.123")}, 1}, + {{std::string("2019-00-18 00:00:00"), std::string("2019-07-18 00:00:00.123")}, + Null()}, + {{std::string("2019-07-18 00:00:00"), std::string("2019-07-00 00:00:00.123")}, + Null()}}; + + check_function(func_name, input_types, data_set); + } + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::DateTime}; + + DataSet data_set = { + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-19 00:00:00")}, -1}, + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-17 00:00:00")}, 1}, + {{std::string("2019-00-18 00:00:00.123"), std::string("2019-07-18 00:00:00")}, + Null()}, + {{std::string("2019-07-18 00:00:00.123"), std::string("2019-07-00 00:00:00")}, + Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, date_format_v2_test) { std::string func_name = "date_format"; - InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; { + InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; + DataSet data_set = {{{std::string("2009-10-04"), std::string("%W %M %Y")}, + std::string("Sunday October 2009")}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; + DataSet data_set = { + {{std::string("2007-10-04"), std::string("%H:%i:%s")}, std::string("00:00:00")}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; + DataSet data_set = {{{std::string("1900-10-04"), std::string("%D %y %a %d %m %b %j")}, + std::string("4th 00 Thu 04 10 Oct 277")}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; + DataSet data_set = {{{std::string("1999-01-01 00:00:00"), std::string("%X %V")}, + std::string("1998 52")}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; + DataSet data_set = { + {{std::string("2006-06-01 00:00:00"), std::string("%d")}, std::string("01")}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateV2, Consted {TypeIndex::String}}; + DataSet data_set = { + {{std::string("2006-06-01 00:00:00"), std::string("%%%d")}, std::string("%01")}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = {{{std::string("2009-10-04 22:23:00"), std::string("%W %M %Y")}, std::string("Sunday October 2009")}}; check_function(func_name, input_types, data_set); } { + InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = {{{std::string("2007-10-04 22:23:00"), std::string("%H:%i:%s")}, - std::string("00:00:00")}}; + std::string("22:23:00")}}; check_function(func_name, input_types, data_set); } { + InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = { {{std::string("1900-10-04 22:23:00"), std::string("%D %y %a %d %m %b %j")}, std::string("4th 00 Thu 04 10 Oct 277")}}; @@ -849,25 +1154,29 @@ TEST(VTimestampFunctionsTest, date_format_v2_test) { check_function(func_name, input_types, data_set); } { + InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = { {{std::string("1997-10-04 22:23:00"), std::string("%H %k %I %r %T %S %w")}, - std::string("00 0 12 12:00:00 AM 00:00:00 00 6")}}; + std::string("22 22 10 10:23:00 PM 22:23:00 00 6")}}; check_function(func_name, input_types, data_set); } { + InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = {{{std::string("1999-01-01 00:00:00"), std::string("%X %V")}, std::string("1998 52")}}; check_function(func_name, input_types, data_set); } { + InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = { {{std::string("2006-06-01 00:00:00"), std::string("%d")}, std::string("01")}}; check_function(func_name, input_types, data_set); } { + InputTypeSet input_types = {TypeIndex::DateTimeV2, Consted {TypeIndex::String}}; DataSet data_set = { {{std::string("2006-06-01 00:00:00"), std::string("%%%d")}, std::string("%01")}}; @@ -878,163 +1187,341 @@ TEST(VTimestampFunctionsTest, date_format_v2_test) { TEST(VTimestampFunctionsTest, years_add_v2_test) { std::string func_name = "years_add"; - InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; - DataSet data_set = {{{std::string("2020-05-23"), 5}, str_to_date_v2("2025-05-23", "%Y-%m-%d")}, - {{std::string("2020-05-23"), -5}, str_to_date_v2("2015-05-23", "%Y-%m-%d")}, - {{std::string(""), 5}, Null()}, - {{std::string("2020-05-23"), 8000}, Null()}, - {{Null(), 5}, Null()}}; + DataSet data_set = { + {{std::string("2020-05-23"), 5}, str_to_date_v2("2025-05-23", "%Y-%m-%d")}, + {{std::string("2020-05-23"), -5}, str_to_date_v2("2015-05-23", "%Y-%m-%d")}, + {{std::string(""), 5}, Null()}, + {{std::string("2020-05-23"), 8000}, Null()}, + {{Null(), 5}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23 00:00:11.123"), 5}, + str_to_datetime_v2("2025-05-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 00:00:11.123"), -5}, + str_to_datetime_v2("2015-05-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 5}, Null()}, + {{std::string("2020-05-23 00:00:11.123"), 8000}, Null()}, + {{Null(), 5}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, years_sub_v2_test) { std::string func_name = "years_sub"; - InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; - DataSet data_set = {{{std::string("2020-05-23"), 5}, str_to_date_v2("2015-05-23", "%Y-%m-%d")}, - {{std::string("2020-05-23"), -5}, str_to_date_v2("2025-05-23", "%Y-%m-%d")}, - {{std::string(""), 5}, Null()}, - {{std::string("2020-05-23"), 3000}, Null()}, - {{Null(), 5}, Null()}}; + DataSet data_set = { + {{std::string("2020-05-23"), 5}, str_to_date_v2("2015-05-23", "%Y-%m-%d")}, + {{std::string("2020-05-23"), -5}, str_to_date_v2("2025-05-23", "%Y-%m-%d")}, + {{std::string(""), 5}, Null()}, + {{std::string("2020-05-23"), 3000}, Null()}, + {{Null(), 5}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23 00:00:11.123"), 5}, + str_to_datetime_v2("2015-05-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 00:00:11.123"), -5}, + str_to_datetime_v2("2025-05-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 5}, Null()}, + {{std::string("2020-05-23 00:00:11.123"), 3000}, Null()}, + {{Null(), 5}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, months_add_v2_test) { std::string func_name = "months_add"; - InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; - DataSet data_set = {{{std::string("2020-10-23"), -4}, str_to_date_v2("2020-06-23", "%Y-%m-%d")}, - {{std::string("2020-05-23"), 4}, str_to_date_v2("2020-09-23", "%Y-%m-%d")}, - {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23"), 10}, str_to_date_v2("2021-03-23", "%Y-%m-%d")}, - {{Null(), 4}, Null()}}; + DataSet data_set = { + {{std::string("2020-10-23"), -4}, str_to_date_v2("2020-06-23", "%Y-%m-%d")}, + {{std::string("2020-05-23"), 4}, str_to_date_v2("2020-09-23", "%Y-%m-%d")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 10}, str_to_date_v2("2021-03-23", "%Y-%m-%d")}, + {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-10-23 00:00:11.123"), -4}, + str_to_datetime_v2("2020-06-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 00:00:11.123"), 4}, + str_to_datetime_v2("2020-09-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 00:00:11.123"), 10}, + str_to_datetime_v2("2021-03-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, months_sub_v2_test) { std::string func_name = "months_sub"; - InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; - DataSet data_set = {{{std::string("2020-05-23"), 4}, str_to_date_v2("2020-01-23", "%Y-%m-%d")}, - {{std::string("2020-05-23"), -4}, str_to_date_v2("2020-09-23", "%Y-%m-%d")}, - {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23"), 10}, str_to_date_v2("2019-07-23", "%Y-%m-%d")}, - {{Null(), 4}, Null()}}; + DataSet data_set = { + {{std::string("2020-05-23"), 4}, str_to_date_v2("2020-01-23", "%Y-%m-%d")}, + {{std::string("2020-05-23"), -4}, str_to_date_v2("2020-09-23", "%Y-%m-%d")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 10}, str_to_date_v2("2019-07-23", "%Y-%m-%d")}, + {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23 00:00:11.123"), 4}, + str_to_datetime_v2("2020-01-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 00:00:11.123"), -4}, + str_to_datetime_v2("2020-09-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 00:00:11.123"), 10}, + str_to_datetime_v2("2019-07-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, days_add_v2_test) { std::string func_name = "days_add"; - InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; - DataSet data_set = {{{std::string("2020-10-23"), -4}, str_to_date_v2("2020-10-19", "%Y-%m-%d")}, - {{std::string("2020-05-23"), 4}, str_to_date_v2("2020-05-27", "%Y-%m-%d")}, - {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23"), 10}, str_to_date_v2("2020-06-02", "%Y-%m-%d")}, - {{Null(), 4}, Null()}}; + DataSet data_set = { + {{std::string("2020-10-23"), -4}, str_to_date_v2("2020-10-19", "%Y-%m-%d")}, + {{std::string("2020-05-23"), 4}, str_to_date_v2("2020-05-27", "%Y-%m-%d")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 10}, str_to_date_v2("2020-06-02", "%Y-%m-%d")}, + {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-10-23 00:00:11.123"), -4}, + str_to_datetime_v2("2020-10-19 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 00:00:11.123"), 4}, + str_to_datetime_v2("2020-05-27 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 00:00:11.123"), 10}, + str_to_datetime_v2("2020-06-02 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, days_sub_v2_test) { std::string func_name = "days_sub"; - InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; - DataSet data_set = {{{std::string("2020-05-23"), 4}, str_to_date_v2("2020-05-19", "%Y-%m-%d")}, - {{std::string("2020-05-23"), -4}, str_to_date_v2("2020-05-27", "%Y-%m-%d")}, - {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23"), 31}, str_to_date_v2("2020-04-22", "%Y-%m-%d")}, - {{Null(), 4}, Null()}}; + DataSet data_set = { + {{std::string("2020-05-23"), 4}, str_to_date_v2("2020-05-19", "%Y-%m-%d")}, + {{std::string("2020-05-23"), -4}, str_to_date_v2("2020-05-27", "%Y-%m-%d")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 31}, str_to_date_v2("2020-04-22", "%Y-%m-%d")}, + {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23 00:00:11.123"), 4}, + str_to_datetime_v2("2020-05-19 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 00:00:11.123"), -4}, + str_to_datetime_v2("2020-05-27 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 00:00:11.123"), 31}, + str_to_datetime_v2("2020-04-22 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, weeks_add_v2_test) { std::string func_name = "weeks_add"; - InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; - DataSet data_set = { - {{std::string("2020-10-23"), 5}, str_to_date_v2("2020-11-27", "%Y-%m-%d")}, - {{std::string("2020-05-23"), -5}, str_to_date_v2("2020-04-18", "%Y-%m-%d")}, - {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23"), 100}, str_to_date_v2("2022-04-23", "%Y-%m-%d")}, - {{Null(), 4}, Null()}}; + DataSet data_set = { + {{std::string("2020-10-23"), 5}, str_to_date_v2("2020-11-27", "%Y-%m-%d")}, + {{std::string("2020-05-23"), -5}, str_to_date_v2("2020-04-18", "%Y-%m-%d")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 100}, str_to_date_v2("2022-04-23", "%Y-%m-%d")}, + {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-10-23 00:00:11.123"), 5}, + str_to_datetime_v2("2020-11-27 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 00:00:11.123"), -5}, + str_to_datetime_v2("2020-04-18 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 00:00:11.123"), 100}, + str_to_datetime_v2("2022-04-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, weeks_sub_v2_test) { std::string func_name = "weeks_sub"; - InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; - DataSet data_set = { - {{std::string("2020-05-23"), 5}, str_to_date_v2("2020-04-18", "%Y-%m-%d")}, - {{std::string("2020-05-23"), -5}, str_to_date_v2("2020-06-27", "%Y-%m-%d")}, - {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23"), 100}, str_to_date_v2("2018-06-23", "%Y-%m-%d")}, - {{Null(), 4}, Null()}}; + DataSet data_set = { + {{std::string("2020-05-23"), 5}, str_to_date_v2("2020-04-18", "%Y-%m-%d")}, + {{std::string("2020-05-23"), -5}, str_to_date_v2("2020-06-27", "%Y-%m-%d")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 100}, str_to_date_v2("2018-06-23", "%Y-%m-%d")}, + {{Null(), 4}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23 00:00:11.123"), 5}, + str_to_datetime_v2("2020-04-18 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 00:00:11.123"), -5}, + str_to_datetime_v2("2020-06-27 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 00:00:11.123"), 100}, + str_to_datetime_v2("2018-06-23 00:00:11.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, to_days_v2_test) { std::string func_name = "to_days"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2021-01-01")}, 738156}, - {{std::string("")}, Null()}, - {{std::string("2021-01-32")}, Null()}, - {{std::string("0000-01-01")}, Null()}}; + DataSet data_set = {{{std::string("2021-01-01")}, 738156}, + {{std::string("")}, Null()}, + {{std::string("2021-01-32")}, Null()}, + {{std::string("0000-01-01")}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2021-01-01 00:00:11.123")}, 738156}, + {{std::string("")}, Null()}, + {{std::string("2021-01-32 00:00:11.123")}, Null()}, + {{std::string("0000-01-01 00:00:11.123")}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, date_v2_test) { std::string func_name = "date"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2021-01-01")}, str_to_date_v2("2021-01-01", "%Y-%m-%d")}, - {{std::string("")}, Null()}, - {{Null()}, Null()}, - {{std::string("0000-01-01")}, Null()}}; + DataSet data_set = {{{std::string("2021-01-01")}, str_to_date_v2("2021-01-01", "%Y-%m-%d")}, + {{std::string("")}, Null()}, + {{Null()}, Null()}, + {{std::string("0000-01-01")}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2021-01-01 00:00:11.123")}, + str_to_date_v2("2021-01-01", "%Y-%m-%d")}, + {{std::string("")}, Null()}, + {{Null()}, Null()}, + {{std::string("0000-01-01 00:00:11.123")}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, week_v2_test) { std::string func_name = "week"; - InputTypeSet new_input_types = {TypeIndex::DateV2}; - DataSet new_data_set = {{{std::string("1989-03-21")}, 12}, - {{std::string("")}, Null()}, - {{std::string("9999-12-12")}, 50}}; + { + InputTypeSet new_input_types = {TypeIndex::DateV2}; + DataSet new_data_set = {{{std::string("1989-03-21")}, 12}, + {{std::string("")}, Null()}, + {{std::string("9999-12-12")}, 50}}; - check_function(func_name, new_input_types, new_data_set); + check_function(func_name, new_input_types, new_data_set); + } + { + InputTypeSet new_input_types = {TypeIndex::DateTimeV2}; + DataSet new_data_set = {{{std::string("1989-03-21 00:00:11.123")}, 12}, + {{std::string("")}, Null()}, + {{std::string("9999-12-12 00:00:11.123")}, 50}}; + + check_function(func_name, new_input_types, new_data_set); + } } TEST(VTimestampFunctionsTest, yearweek_v2_test) { std::string func_name = "yearweek"; - InputTypeSet new_input_types = {TypeIndex::DateV2}; - DataSet new_data_set = {{{std::string("1989-03-21")}, 198912}, - {{std::string("")}, Null()}, - {{std::string("9999-12-12")}, 999950}}; + { + InputTypeSet new_input_types = {TypeIndex::DateV2}; + DataSet new_data_set = {{{std::string("1989-03-21")}, 198912}, + {{std::string("")}, Null()}, + {{std::string("9999-12-12")}, 999950}}; - check_function(func_name, new_input_types, new_data_set); + check_function(func_name, new_input_types, new_data_set); + } + { + InputTypeSet new_input_types = {TypeIndex::DateTimeV2}; + DataSet new_data_set = {{{std::string("1989-03-21 00:00:11.123")}, 198912}, + {{std::string("")}, Null()}, + {{std::string("9999-12-12 00:00:11.123")}, 999950}}; + + check_function(func_name, new_input_types, new_data_set); + } } TEST(VTimestampFunctionsTest, str_to_date_test) { @@ -1069,14 +1556,26 @@ TEST(VTimestampFunctionsTest, from_days_test) { TEST(VTimestampFunctionsTest, weekday_v2_test) { std::string func_name = "weekday"; - InputTypeSet input_types = {TypeIndex::DateV2}; + { + InputTypeSet input_types = {TypeIndex::DateV2}; - DataSet data_set = {{{std::string("2001-02-03")}, 5}, - {{std::string("2019-06-25")}, 1}, - {{std::string("2020-00-01")}, Null()}, - {{std::string("2020-01-00")}, Null()}}; + DataSet data_set = {{{std::string("2001-02-03")}, 5}, + {{std::string("2019-06-25")}, 1}, + {{std::string("2020-00-01")}, Null()}, + {{std::string("2020-01-00")}, Null()}}; - check_function(func_name, input_types, data_set); + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2001-02-03 00:00:11.123")}, 5}, + {{std::string("2019-06-25 00:00:11.123")}, 1}, + {{std::string("2020-00-01 00:00:11.123")}, Null()}, + {{std::string("2020-01-00 00:00:11.123")}, Null()}}; + + check_function(func_name, input_types, data_set); + } } TEST(VTimestampFunctionsTest, dayname_test) { @@ -1108,6 +1607,214 @@ TEST(VTimestampFunctionsTest, dayname_test) { check_function(func_name, input_types, data_set); } + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2}; + + DataSet data_set = {{{std::string("2007-02-03 00:00:11.123")}, std::string("Saturday")}, + {{std::string("2020-01-00 00:00:11.123")}, Null()}}; + + check_function(func_name, input_types, data_set); + } +} + +TEST(VTimestampFunctionsTest, hours_add_v2_test) { + std::string func_name = "hours_add"; + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-10-23 10:00:00.123"), -4}, + str_to_datetime_v2("2020-10-23 06:00:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 10:00:00.123"), 4}, + str_to_datetime_v2("2020-05-23 14:00:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 10:00:00.123"), 100}, + str_to_datetime_v2("2020-05-27 14:00:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-10-23"), -4}, + str_to_datetime_v2("2020-10-22 20:00:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23"), 4}, + str_to_datetime_v2("2020-05-23 04:00:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 100}, + str_to_datetime_v2("2020-05-27 04:00:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } +} + +TEST(VTimestampFunctionsTest, hours_sub_v2_test) { + std::string func_name = "hours_sub"; + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23 10:00:00.123"), 4}, + str_to_datetime_v2("2020-05-23 06:00:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 10:00:00.123"), -4}, + str_to_datetime_v2("2020-05-23 14:00:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 10:00:00.123"), 31}, + str_to_datetime_v2("2020-05-22 03:00:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } + + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23"), 4}, + str_to_datetime_v2("2020-05-22 20:00:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23"), -4}, + str_to_datetime_v2("2020-05-23 04:00:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 31}, + str_to_datetime_v2("2020-05-21 17:00:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } +} + +TEST(VTimestampFunctionsTest, minutes_add_v2_test) { + std::string func_name = "minutes_add"; + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-10-23 10:00:00.123"), 40}, + str_to_datetime_v2("2020-10-23 10:40:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 10:00:00.123"), -40}, + str_to_datetime_v2("2020-05-23 09:20:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 10:00:00.123"), 100}, + str_to_datetime_v2("2020-05-23 11:40:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-10-23"), 40}, + str_to_datetime_v2("2020-10-23 00:40:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23"), -40}, + str_to_datetime_v2("2020-05-22 23:20:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 100}, + str_to_datetime_v2("2020-05-23 01:40:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } +} + +TEST(VTimestampFunctionsTest, minutes_sub_v2_test) { + std::string func_name = "minutes_sub"; + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23 10:00:00.123"), 40}, + str_to_datetime_v2("2020-05-23 09:20:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 10:00:00.123"), -40}, + str_to_datetime_v2("2020-05-23 10:40:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 10:00:00.123"), 100}, + str_to_datetime_v2("2020-05-23 08:20:00.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23"), 40}, + str_to_datetime_v2("2020-05-22 23:20:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23"), -40}, + str_to_datetime_v2("2020-05-23 00:40:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 100}, + str_to_datetime_v2("2020-05-22 22:20:00", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } +} + +TEST(VTimestampFunctionsTest, seconds_add_v2_test) { + std::string func_name = "seconds_add"; + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-10-23 10:00:00.123"), 40}, + str_to_datetime_v2("2020-10-23 10:00:40.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 10:00:00.123"), -40}, + str_to_datetime_v2("2020-05-23 09:59:20.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 10:00:00.123"), 100}, + str_to_datetime_v2("2020-05-23 10:01:40.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-10-23"), 40}, + str_to_datetime_v2("2020-10-23 00:00:40", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23"), -40}, + str_to_datetime_v2("2020-05-22 23:59:20", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 100}, + str_to_datetime_v2("2020-05-23 00:01:40", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } +} + +TEST(VTimestampFunctionsTest, seconds_sub_v2_test) { + std::string func_name = "seconds_sub"; + + { + InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23 10:00:00.123"), 40}, + str_to_datetime_v2("2020-05-23 09:59:20.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23 10:00:00.123"), -40}, + str_to_datetime_v2("2020-05-23 10:00:40.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23 10:00:00.123"), 100}, + str_to_datetime_v2("2020-05-23 09:58:20.123", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } + { + InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Int32}; + + DataSet data_set = {{{std::string("2020-05-23"), 40}, + str_to_datetime_v2("2020-05-22 23:59:20", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string("2020-05-23"), -40}, + str_to_datetime_v2("2020-05-23 00:00:40", "%Y-%m-%d %H:%i:%s.%f")}, + {{std::string(""), 4}, Null()}, + {{std::string("2020-05-23"), 100}, + str_to_datetime_v2("2020-05-22 23:58:20", "%Y-%m-%d %H:%i:%s.%f")}, + {{Null(), 4}, Null()}}; + + check_function(func_name, input_types, data_set); + } } } // namespace doris::vectorized diff --git a/gensrc/script/doris_builtins_functions.py b/gensrc/script/doris_builtins_functions.py index bdc1e54ac7..041fcb4e97 100755 --- a/gensrc/script/doris_builtins_functions.py +++ b/gensrc/script/doris_builtins_functions.py @@ -126,6 +126,8 @@ visible_functions = [ [['element_at', '%element_extract%'], 'LARGEINT', ['ARRAY_LARGEINT', 'BIGINT'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], [['element_at', '%element_extract%'], 'DATETIME', ['ARRAY_DATETIME', 'BIGINT'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], [['element_at', '%element_extract%'], 'DATE', ['ARRAY_DATE', 'BIGINT'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['element_at', '%element_extract%'], 'DATETIMEV2', ['ARRAY_DATETIMEV2', 'BIGINT'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['element_at', '%element_extract%'], 'DATEV2', ['ARRAY_DATEV2', 'BIGINT'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], [['element_at', '%element_extract%'], 'FLOAT', ['ARRAY_FLOAT', 'BIGINT'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], [['element_at', '%element_extract%'], 'DOUBLE', ['ARRAY_DOUBLE', 'BIGINT'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], [['element_at', '%element_extract%'], 'DECIMALV2', ['ARRAY_DECIMALV2', 'BIGINT'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], @@ -139,6 +141,8 @@ visible_functions = [ [['arrays_overlap'], 'BOOLEAN', ['ARRAY_LARGEINT', 'ARRAY_LARGEINT'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], [['arrays_overlap'], 'BOOLEAN', ['ARRAY_DATETIME', 'ARRAY_DATETIME'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], [['arrays_overlap'], 'BOOLEAN', ['ARRAY_DATE', 'ARRAY_DATE'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['arrays_overlap'], 'BOOLEAN', ['ARRAY_DATETIMEV2', 'ARRAY_DATETIMEV2'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['arrays_overlap'], 'BOOLEAN', ['ARRAY_DATEV2', 'ARRAY_DATEV2'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], [['arrays_overlap'], 'BOOLEAN', ['ARRAY_FLOAT', 'ARRAY_FLOAT'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], [['arrays_overlap'], 'BOOLEAN', ['ARRAY_DOUBLE', 'ARRAY_DOUBLE'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], [['arrays_overlap'], 'BOOLEAN', ['ARRAY_DECIMALV2', 'ARRAY_DECIMALV2'], '', '', '', 'vec', 'ALWAYS_NULLABLE'], @@ -152,6 +156,8 @@ visible_functions = [ [['array_contains'], 'BOOLEAN', ['ARRAY_LARGEINT', 'LARGEINT'], '', '', '', 'vec', ''], [['array_contains'], 'BOOLEAN', ['ARRAY_DATETIME', 'DATETIME'], '', '', '', 'vec', ''], [['array_contains'], 'BOOLEAN', ['ARRAY_DATE', 'DATE'], '', '', '', 'vec', ''], + [['array_contains'], 'BOOLEAN', ['ARRAY_DATETIMEV2', 'DATETIMEV2'], '', '', '', 'vec', ''], + [['array_contains'], 'BOOLEAN', ['ARRAY_DATEV2', 'DATEV2'], '', '', '', 'vec', ''], [['array_contains'], 'BOOLEAN', ['ARRAY_FLOAT', 'FLOAT'], '', '', '', 'vec', ''], [['array_contains'], 'BOOLEAN', ['ARRAY_DOUBLE', 'DOUBLE'], '', '', '', 'vec', ''], [['array_contains'], 'BOOLEAN', ['ARRAY_DECIMALV2', 'DECIMALV2'], '', '', '', 'vec', ''], @@ -166,6 +172,8 @@ visible_functions = [ [['array_position'], 'BIGINT', ['ARRAY_LARGEINT', 'LARGEINT'], '', '', '', 'vec', ''], [['array_position'], 'BIGINT', ['ARRAY_DATETIME', 'DATETIME'], '', '', '', 'vec', ''], [['array_position'], 'BIGINT', ['ARRAY_DATE', 'DATE'], '', '', '', 'vec', ''], + [['array_position'], 'BIGINT', ['ARRAY_DATETIMEV2', 'DATETIMEV2'], '', '', '', 'vec', ''], + [['array_position'], 'BIGINT', ['ARRAY_DATEV2', 'DATEV2'], '', '', '', 'vec', ''], [['array_position'], 'BIGINT', ['ARRAY_FLOAT', 'FLOAT'], '', '', '', 'vec', ''], [['array_position'], 'BIGINT', ['ARRAY_DOUBLE', 'DOUBLE'], '', '', '', 'vec', ''], [['array_position'], 'BIGINT', ['ARRAY_DECIMALV2', 'DECIMALV2'], '', '', '', 'vec', ''], @@ -180,6 +188,8 @@ visible_functions = [ [['array_distinct'], 'ARRAY_LARGEINT', ['ARRAY_LARGEINT'], '', '', '', 'vec', ''], [['array_distinct'], 'ARRAY_DATETIME', ['ARRAY_DATETIME'], '', '', '', 'vec', ''], [['array_distinct'], 'ARRAY_DATE', ['ARRAY_DATE'], '', '', '', 'vec', ''], + [['array_distinct'], 'ARRAY_DATETIMEV2', ['ARRAY_DATETIMEV2'], '', '', '', 'vec', ''], + [['array_distinct'], 'ARRAY_DATEV2', ['ARRAY_DATEV2'], '', '', '', 'vec', ''], [['array_distinct'], 'ARRAY_FLOAT', ['ARRAY_FLOAT'], '', '', '', 'vec', ''], [['array_distinct'], 'ARRAY_DOUBLE', ['ARRAY_DOUBLE'], '', '', '', 'vec', ''], [['array_distinct'], 'ARRAY_DECIMALV2', ['ARRAY_DECIMALV2'], '', '', '', 'vec', ''], @@ -193,6 +203,8 @@ visible_functions = [ [['array_sort'], 'ARRAY_LARGEINT', ['ARRAY_LARGEINT'], '', '', '', 'vec', ''], [['array_sort'], 'ARRAY_DATETIME', ['ARRAY_DATETIME'], '', '', '', 'vec', ''], [['array_sort'], 'ARRAY_DATE', ['ARRAY_DATE'], '', '', '', 'vec', ''], + [['array_sort'], 'ARRAY_DATETIMEV2', ['ARRAY_DATETIMEV2'], '', '', '', 'vec', ''], + [['array_sort'], 'ARRAY_DATEV2', ['ARRAY_DATEV2'], '', '', '', 'vec', ''], [['array_sort'], 'ARRAY_FLOAT', ['ARRAY_FLOAT'], '', '', '', 'vec', ''], [['array_sort'], 'ARRAY_DOUBLE', ['ARRAY_DOUBLE'], '', '', '', 'vec', ''], [['array_sort'], 'ARRAY_DECIMALV2', ['ARRAY_DECIMALV2'], '', '', '', 'vec', ''], @@ -235,6 +247,8 @@ visible_functions = [ [['array_remove'], 'ARRAY_DECIMALV2', ['ARRAY_DECIMALV2', 'DECIMALV2'], '', '', '', 'vec', ''], [['array_remove'], 'ARRAY_DATETIME', ['ARRAY_DATETIME', 'DATETIME'], '', '', '', 'vec', ''], [['array_remove'], 'ARRAY_DATE', ['ARRAY_DATE', 'DATE'], '', '', '', 'vec', ''], + [['array_remove'], 'ARRAY_DATETIMEV2', ['ARRAY_DATETIMEV2', 'DATETIMEV2'], '', '', '', 'vec', ''], + [['array_remove'], 'ARRAY_DATEV2', ['ARRAY_DATEV2', 'DATEV2'], '', '', '', 'vec', ''], [['array_remove'], 'ARRAY_VARCHAR', ['ARRAY_VARCHAR', 'VARCHAR'], '', '', '', 'vec', ''], [['array_remove'], 'ARRAY_STRING', ['ARRAY_STRING', 'STRING'], '', '', '', 'vec', ''], @@ -248,6 +262,8 @@ visible_functions = [ [['array_union'], 'ARRAY_DECIMALV2', ['ARRAY_DECIMALV2', 'ARRAY_DECIMALV2'], '', '', '', 'vec', ''], [['array_union'], 'ARRAY_DATETIME', ['ARRAY_DATETIME', 'ARRAY_DATETIME'], '', '', '', 'vec', ''], [['array_union'], 'ARRAY_DATE', ['ARRAY_DATE', 'ARRAY_DATE'], '', '', '', 'vec', ''], + [['array_union'], 'ARRAY_DATETIMEV2', ['ARRAY_DATETIMEV2', 'ARRAY_DATETIMEV2'], '', '', '', 'vec', ''], + [['array_union'], 'ARRAY_DATEV2', ['ARRAY_DATEV2', 'ARRAY_DATEV2'], '', '', '', 'vec', ''], [['array_union'], 'ARRAY_VARCHAR', ['ARRAY_VARCHAR', 'ARRAY_VARCHAR'], '', '', '', 'vec', ''], [['array_union'], 'ARRAY_STRING', ['ARRAY_STRING', 'ARRAY_STRING'], '', '', '', 'vec', ''], @@ -261,6 +277,8 @@ visible_functions = [ [['array_except'], 'ARRAY_DECIMALV2', ['ARRAY_DECIMALV2', 'ARRAY_DECIMALV2'], '', '', '', 'vec', ''], [['array_except'], 'ARRAY_DATETIME', ['ARRAY_DATETIME', 'ARRAY_DATETIME'], '', '', '', 'vec', ''], [['array_except'], 'ARRAY_DATE', ['ARRAY_DATE', 'ARRAY_DATE'], '', '', '', 'vec', ''], + [['array_except'], 'ARRAY_DATETIMEV2', ['ARRAY_DATETIMEV2', 'ARRAY_DATETIMEV2'], '', '', '', 'vec', ''], + [['array_except'], 'ARRAY_DATEV2', ['ARRAY_DATEV2', 'ARRAY_DATEV2'], '', '', '', 'vec', ''], [['array_except'], 'ARRAY_VARCHAR', ['ARRAY_VARCHAR', 'ARRAY_VARCHAR'], '', '', '', 'vec', ''], [['array_except'], 'ARRAY_STRING', ['ARRAY_STRING', 'ARRAY_STRING'], '', '', '', 'vec', ''], @@ -274,6 +292,8 @@ visible_functions = [ [['array_intersect'], 'ARRAY_DECIMALV2', ['ARRAY_DECIMALV2', 'ARRAY_DECIMALV2'], '', '', '', 'vec', ''], [['array_intersect'], 'ARRAY_DATETIME', ['ARRAY_DATETIME', 'ARRAY_DATETIME'], '', '', '', 'vec', ''], [['array_intersect'], 'ARRAY_DATE', ['ARRAY_DATE', 'ARRAY_DATE'], '', '', '', 'vec', ''], + [['array_intersect'], 'ARRAY_DATETIMEV2', ['ARRAY_DATETIMEV2', 'ARRAY_DATETIMEV2'], '', '', '', 'vec', ''], + [['array_intersect'], 'ARRAY_DATEV2', ['ARRAY_DATEV2', 'ARRAY_DATEV2'], '', '', '', 'vec', ''], [['array_intersect'], 'ARRAY_VARCHAR', ['ARRAY_VARCHAR', 'ARRAY_VARCHAR'], '', '', '', 'vec', ''], [['array_intersect'], 'ARRAY_STRING', ['ARRAY_STRING', 'ARRAY_STRING'], '', '', '', 'vec', ''], @@ -287,6 +307,12 @@ visible_functions = [ [['unix_timestamp'], 'INT', ['DATE'], '_ZN5doris18TimestampFunctions7to_unixEPN9doris_udf15FunctionContextERKNS1_11DateTimeValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['unix_timestamp'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions7to_unixEPN9doris_udf15FunctionContextERKNS1_11DateV2TimeValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['unix_timestamp'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions7to_unixEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], [['unix_timestamp'], 'INT', ['VARCHAR', 'VARCHAR'], '_ZN5doris18TimestampFunctions7to_unixEPN9doris_udf15FunctionContextERKNS1_9StringValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], @@ -313,6 +339,9 @@ visible_functions = [ [['now', 'current_timestamp', 'localtime', 'localtimestamp'], 'DATETIME', [], '_ZN5doris18TimestampFunctions3nowEPN9doris_udf15FunctionContextE', '', '', 'vec', 'ALWAYS_NOT_NULLABLE'], + [['now', 'current_timestamp', 'localtime', 'localtimestamp'], 'DATETIMEV2', [], + '_ZN5doris18TimestampFunctions3nowEPN9doris_udf15FunctionContextE', + '', '', 'vec', 'ALWAYS_NOT_NULLABLE'], [['curtime', 'current_time'], 'TIME', [], '_ZN5doris18TimestampFunctions7curtimeEPN9doris_udf15FunctionContextE', '', '', 'vec', 'ALWAYS_NOT_NULLABLE'], @@ -682,6 +711,857 @@ visible_functions = [ '_ZN5doris18TimestampFunctions11second_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeValERKNS1_6IntValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['curdate', 'current_date'], 'DATEV2', [], + '_ZN5doris18TimestampFunctions7curdateEPN9doris_udf15FunctionContextE', + '', '', 'vec', 'ALWAYS_NOT_NULLABLE'], + [['utc_timestamp'], 'DATETIMEV2', [], + '_ZN5doris18TimestampFunctions13utc_timestampEPN9doris_udf15FunctionContextE', + '', '', 'vec', 'ALWAYS_NOT_NULLABLE'], + [['timestamp'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions9timestampEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['from_days'], 'DATEV2', ['INT'], + '_ZN5doris18TimestampFunctions9from_daysEPN9doris_udf15FunctionContextERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['to_days'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions7to_daysEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['year'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions4yearEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions5monthEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['quarter'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions7quarterEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['dayofweek'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions11day_of_weekEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weekday'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions8week_dayEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day', 'dayofmonth'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions12day_of_monthEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['dayofyear'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions11day_of_yearEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weekofyear'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions12week_of_yearEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['yearweek'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions9year_weekEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['yearweek'], 'INT', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9year_weekEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions4weekEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week'], 'INT', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions4weekEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions4hourEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions6minuteEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second'], 'INT', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions6secondEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['year'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions4yearEPN9doris_udf15FunctionContextERKNS1_11DateV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions5monthEPN9doris_udf15FunctionContextERKNS1_11DateV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['quarter'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions7quarterEPN9doris_udf15FunctionContextERKNS1_11DateV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['dayofweek'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions11day_of_weekEPN9doris_udf15FunctionContextERKNS1_11DateV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weekday'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions8week_dayEPN9doris_udf15FunctionContextERKNS1_11DateV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day', 'dayofmonth'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions12day_of_monthEPN9doris_udf' + '15FunctionContextERKNS1_11DateV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['dayofyear'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions11day_of_yearEPN9doris_udf' + '15FunctionContextERKNS1_11DateV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weekofyear'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions12week_of_yearEPN9doris_udf' + '15FunctionContextERKNS1_11DateV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['yearweek'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions9year_weekEPN9doris_udf15FunctionContextERKNS1_11DateV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['yearweek'], 'INT', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9year_weekEPN9doris_udf15FunctionContextERKNS1_11DateV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions4weekEPN9doris_udf15FunctionContextERKNS1_11DateV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week'], 'INT', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions4weekEPN9doris_udf15FunctionContextERKNS1_11DateV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions4hourEPN9doris_udf15FunctionContextERKNS1_11DateV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions6minuteEPN9doris_udf15FunctionContextERKNS1_11DateV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second'], 'INT', ['DATEV2'], + '_ZN5doris18TimestampFunctions6secondEPN9doris_udf15FunctionContextERKNS1_11DateV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['makedate'], 'DATETIMEV2', ['INT', 'INT'], + '_ZN5doris18TimestampFunctions9make_dateEPN9doris_udf15FunctionContextERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['years_add'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9years_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['years_sub'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9years_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_add', 'add_months'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions10months_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_sub'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions10months_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_add'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9weeks_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_sub'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9weeks_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_add', 'date_add', 'adddate'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions8days_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_sub', 'date_sub', 'subdate'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions8days_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_add'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9hours_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_sub'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9hours_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_add'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions11minutes_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_sub'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions11minutes_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_add'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions11seconds_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_sub'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions11seconds_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['microseconds_add'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions10micros_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', '', ''], + [['microseconds_sub'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions10micros_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', '', ''], + + [['makedate'], 'DATEV2', ['INT', 'INT'], + '_ZN5doris18TimestampFunctions9make_dateEPN9doris_udf15FunctionContextERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['years_add'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9years_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['years_sub'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9years_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_add', 'add_months'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions10months_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_sub'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions10months_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_add'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9weeks_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_sub'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9weeks_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_add', 'date_add', 'adddate'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions8days_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_sub', 'date_sub', 'subdate'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions8days_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_add'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9hours_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_sub'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9hours_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_add'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions11minutes_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_sub'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions11minutes_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_add'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions11seconds_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_sub'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions11seconds_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['microseconds_add'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions10micros_addEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', '', ''], + [['microseconds_sub'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions10micros_subEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', '', ''], + + [['datediff'], 'INT', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9date_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['timediff'], 'TIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9time_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['datediff'], 'INT', ['DATETIMEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions9date_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['timediff'], 'TIMEV2', ['DATETIMEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions9time_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['datediff'], 'INT', ['DATEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9date_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['timediff'], 'TIMEV2', ['DATEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9time_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['datediff'], 'INT', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions9date_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['timediff'], 'TIMEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions9time_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['datediff'], 'INT', ['DATETIMEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions9date_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['timediff'], 'TIMEV2', ['DATETIMEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions9time_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['datediff'], 'INT', ['DATEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions9date_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['timediff'], 'TIMEV2', ['DATEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions9time_diffEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['str_to_date'], 'DATETIMEV2', ['VARCHAR', 'VARCHAR'], + '_ZN5doris18TimestampFunctions11str_to_dateEPN9doris_udf' + '15FunctionContextERKNS1_9StringValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['str_to_date'], 'DATETIMEV2', ['STRING', 'STRING'], + '_ZN5doris18TimestampFunctions11str_to_dateEPN9doris_udf' + '15FunctionContextERKNS1_9StringValES6_', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['date_format'], 'VARCHAR', ['DATETIMEV2', 'VARCHAR'], + '_ZN5doris18TimestampFunctions11date_formatEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_9StringValE', + '_ZN5doris18TimestampFunctions14format_prepareEPN9doris_udf' + '15FunctionContextENS2_18FunctionStateScopeE', + '_ZN5doris18TimestampFunctions12format_closeEPN9doris_udf' + '15FunctionContextENS2_18FunctionStateScopeE', 'vec', 'ALWAYS_NULLABLE'], + [['date_format'], 'VARCHAR', ['DATEV2', 'VARCHAR'], + '_ZN5doris18TimestampFunctions11date_formatEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValERKNS1_9StringValE', + '_ZN5doris18TimestampFunctions14format_prepareEPN9doris_udf' + '15FunctionContextENS2_18FunctionStateScopeE', + '_ZN5doris18TimestampFunctions12format_closeEPN9doris_udf' + '15FunctionContextENS2_18FunctionStateScopeE', 'vec', 'ALWAYS_NULLABLE'], + [['date', 'to_date'], 'DATEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions7to_dateEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['dayname'], 'VARCHAR', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions8day_nameEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['monthname'], 'VARCHAR', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions10month_nameEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['dayname'], 'VARCHAR', ['DATEV2'], + '_ZN5doris18TimestampFunctions8day_nameEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + [['monthname'], 'VARCHAR', ['DATEV2'], + '_ZN5doris18TimestampFunctions10month_nameEPN9doris_udf' + '15FunctionContextERKNS1_11DateTimeV2ValE', '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['convert_tz'], 'DATETIMEV2', ['DATETIMEV2', 'VARCHAR', 'VARCHAR'], + '_ZN5doris18TimestampFunctions10convert_tzEPN9doris_udf15FunctionContextERKNS1_11DateV2ValERKNS1_9StringValES9_', + '_ZN5doris18TimestampFunctions18convert_tz_prepareEPN9doris_udf15FunctionContextENS2_18FunctionStateScopeE', + '_ZN5doris18TimestampFunctions16convert_tz_closeEPN9doris_udf15FunctionContextENS2_18FunctionStateScopeE', + 'vec', 'ALWAYS_NULLABLE'], + + [['convert_tz'], 'DATEV2', ['DATEV2', 'VARCHAR', 'VARCHAR'], + '_ZN5doris18TimestampFunctions10convert_tzEPN9doris_udf15FunctionContextERKNS1_11DateV2ValERKNS1_9StringValES9_', + '_ZN5doris18TimestampFunctions18convert_tz_prepareEPN9doris_udf15FunctionContextENS2_18FunctionStateScopeE', + '_ZN5doris18TimestampFunctions16convert_tz_closeEPN9doris_udf15FunctionContextENS2_18FunctionStateScopeE', + 'vec', 'ALWAYS_NULLABLE'], + + [['years_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10years_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions11months_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10weeks_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9days_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10hours_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions12minutes_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions12seconds_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['years_diff'], 'BIGINT', ['DATEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10years_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_diff'], 'BIGINT', ['DATEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions11months_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_diff'], 'BIGINT', ['DATEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10weeks_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_diff'], 'BIGINT', ['DATEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9days_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_diff'], 'BIGINT', ['DATEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10hours_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_diff'], 'BIGINT', ['DATEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions12minutes_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_diff'], 'BIGINT', ['DATEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions12seconds_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['years_diff'], 'BIGINT', ['DATETIMEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions10years_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_diff'], 'BIGINT', ['DATETIMEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions11months_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_diff'], 'BIGINT', ['DATETIMEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions10weeks_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_diff'], 'BIGINT', ['DATETIMEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions9days_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_diff'], 'BIGINT', ['DATETIMEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions10hours_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_diff'], 'BIGINT', ['DATETIMEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions12minutes_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_diff'], 'BIGINT', ['DATETIMEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions12seconds_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['years_diff'], 'BIGINT', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions10years_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_diff'], 'BIGINT', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions11months_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_diff'], 'BIGINT', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions10weeks_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_diff'], 'BIGINT', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions9days_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_diff'], 'BIGINT', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions10hours_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_diff'], 'BIGINT', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions12minutes_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_diff'], 'BIGINT', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions12seconds_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['years_diff'], 'BIGINT', ['DATEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions10years_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_diff'], 'BIGINT', ['DATEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions11months_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_diff'], 'BIGINT', ['DATEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions10weeks_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_diff'], 'BIGINT', ['DATEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions9days_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_diff'], 'BIGINT', ['DATEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions10hours_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_diff'], 'BIGINT', ['DATEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions12minutes_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_diff'], 'BIGINT', ['DATEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions12seconds_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['years_diff'], 'BIGINT', ['DATETIME', 'DATEV2'], + '_ZN5doris18TimestampFunctions10years_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_diff'], 'BIGINT', ['DATETIME', 'DATEV2'], + '_ZN5doris18TimestampFunctions11months_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_diff'], 'BIGINT', ['DATETIME', 'DATEV2'], + '_ZN5doris18TimestampFunctions10weeks_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_diff'], 'BIGINT', ['DATETIME', 'DATEV2'], + '_ZN5doris18TimestampFunctions9days_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_diff'], 'BIGINT', ['DATETIME', 'DATEV2'], + '_ZN5doris18TimestampFunctions10hours_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_diff'], 'BIGINT', ['DATETIME', 'DATEV2'], + '_ZN5doris18TimestampFunctions12minutes_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_diff'], 'BIGINT', ['DATETIME', 'DATEV2'], + '_ZN5doris18TimestampFunctions12seconds_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['years_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions10years_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions11months_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions10weeks_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions9days_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions10hours_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions12minutes_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_diff'], 'BIGINT', ['DATETIMEV2', 'DATETIME'], + '_ZN5doris18TimestampFunctions12seconds_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['years_diff'], 'BIGINT', ['DATETIME', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10years_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['months_diff'], 'BIGINT', ['DATETIME', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions11months_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['weeks_diff'], 'BIGINT', ['DATETIME', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10weeks_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['days_diff'], 'BIGINT', ['DATETIME', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9days_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hours_diff'], 'BIGINT', ['DATETIME', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10hours_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minutes_diff'], 'BIGINT', ['DATETIME', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions12minutes_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['seconds_diff'], 'BIGINT', ['DATETIME', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions12seconds_diffEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['year_floor'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions10year_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_floor'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10year_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions10year_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10year_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_ceil'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions9year_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9year_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9year_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9year_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_floor'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions11month_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_floor'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions11month_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions11month_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions11month_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_ceil'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions10month_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10month_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions10month_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10month_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_floor'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions10week_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_floor'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10week_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions10week_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10week_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_ceil'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions9week_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9week_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9week_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9week_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_floor'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions9day_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_floor'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9day_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9day_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9day_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_ceil'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions8day_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions8day_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions8day_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions8day_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_floor'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions10hour_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_floor'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10hour_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions10hour_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions10hour_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_ceil'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions9hour_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9hour_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions9hour_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions9hour_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_floor'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions12minute_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_floor'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions12minute_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions12minute_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions12minute_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_ceil'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions11minute_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions11minute_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions11minute_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions11minute_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_floor'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions12second_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_floor'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions12second_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions12second_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_floor'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions12second_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_ceil'], 'DATETIMEV2', ['DATETIMEV2'], + '_ZN5doris18TimestampFunctions11second_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions11second_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT'], + '_ZN5doris18TimestampFunctions11second_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_ceil'], 'DATETIMEV2', ['DATETIMEV2', 'INT', 'DATETIMEV2'], + '_ZN5doris18TimestampFunctions11second_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + + [['year_floor'], 'DATEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions10year_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_floor'], 'DATEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions10year_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_floor'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions10year_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_floor'], 'DATEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions10year_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_ceil'], 'DATEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions9year_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_ceil'], 'DATEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions9year_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_ceil'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9year_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['year_ceil'], 'DATEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions9year_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_floor'], 'DATEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions11month_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_floor'], 'DATEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions11month_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_floor'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions11month_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_floor'], 'DATEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions11month_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_ceil'], 'DATEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions10month_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_ceil'], 'DATEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions10month_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_ceil'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions10month_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['month_ceil'], 'DATEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions10month_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_floor'], 'DATEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions10week_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_floor'], 'DATEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions10week_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_floor'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions10week_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_floor'], 'DATEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions10week_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_ceil'], 'DATEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions9week_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_ceil'], 'DATEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions9week_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_ceil'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9week_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['week_ceil'], 'DATEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions9week_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_floor'], 'DATEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions9day_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_floor'], 'DATEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions9day_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_floor'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9day_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_floor'], 'DATEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions9day_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_ceil'], 'DATEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions8day_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_ceil'], 'DATEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions8day_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_ceil'], 'DATEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions8day_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['day_ceil'], 'DATEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions8day_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_floor'], 'DATETIMEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions10hour_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_floor'], 'DATETIMEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions10hour_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_floor'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions10hour_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_floor'], 'DATETIMEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions10hour_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_ceil'], 'DATETIMEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions9hour_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_ceil'], 'DATETIMEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions9hour_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_ceil'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions9hour_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['hour_ceil'], 'DATETIMEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions9hour_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_floor'], 'DATETIMEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions12minute_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_floor'], 'DATETIMEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions12minute_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_floor'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions12minute_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_floor'], 'DATETIMEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions12minute_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_ceil'], 'DATETIMEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions11minute_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_ceil'], 'DATETIMEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions11minute_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_ceil'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions11minute_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['minute_ceil'], 'DATETIMEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions11minute_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_floor'], 'DATETIMEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions12second_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_floor'], 'DATETIMEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions12second_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_floor'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions12second_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_floor'], 'DATETIMEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions12second_floorEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_ceil'], 'DATETIMEV2', ['DATEV2'], + '_ZN5doris18TimestampFunctions11second_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_ceil'], 'DATETIMEV2', ['DATEV2', 'DATEV2'], + '_ZN5doris18TimestampFunctions11second_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_ceil'], 'DATETIMEV2', ['DATEV2', 'INT'], + '_ZN5doris18TimestampFunctions11second_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValE', + '', '', 'vec', 'ALWAYS_NULLABLE'], + [['second_ceil'], 'DATETIMEV2', ['DATEV2', 'INT', 'DATEV2'], + '_ZN5doris18TimestampFunctions11second_ceilEPN9doris_udf15FunctionContextERKNS1_11DateTimeV2ValERKNS1_6IntValES6_', + '', '', 'vec', 'ALWAYS_NULLABLE'], + # Math builtin functions [['pi'], 'DOUBLE', [], '_ZN5doris13MathFunctions2piEPN9doris_udf15FunctionContextE', '', '', 'vec', 'ALWAYS_NOT_NULLABLE'],