From 8470543144f46ff92fe7ef4364291a9709b06fe7 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 25 May 2022 19:29:01 +0800 Subject: [PATCH] [Improvement] fix typo (#9743) --- be/src/vec/core/types.h | 2 +- .../function/function_array_element_test.cpp | 20 ++-- .../function/function_array_index_test.cpp | 16 ++-- be/test/vec/function/function_ifnull_test.cpp | 4 +- be/test/vec/function/function_nullif_test.cpp | 4 +- be/test/vec/function/function_string_test.cpp | 8 +- be/test/vec/function/function_test_util.cpp | 2 +- be/test/vec/function/function_test_util.h | 2 +- be/test/vec/function/function_time_test.cpp | 94 +++++++++---------- 9 files changed, 76 insertions(+), 76 deletions(-) diff --git a/be/src/vec/core/types.h b/be/src/vec/core/types.h index 0d70204e148b90..3f4d4317dee83f 100644 --- a/be/src/vec/core/types.h +++ b/be/src/vec/core/types.h @@ -138,7 +138,7 @@ struct TypeName { }; template <> struct TypeName { - static const char* get() { return "SringValue"; } + static const char* get() { return "StringValue"; } }; template <> diff --git a/be/test/vec/function/function_array_element_test.cpp b/be/test/vec/function/function_array_element_test.cpp index 39d9c23cab5bd8..1c1be231f6eee8 100644 --- a/be/test/vec/function/function_array_element_test.cpp +++ b/be/test/vec/function/function_array_element_test.cpp @@ -90,13 +90,13 @@ TEST(function_array_element_test, element_at) { { InputTypeSet input_types = {TypeIndex::Array, TypeIndex::DateTime, TypeIndex::Int64}; - Array vec = {str_to_data_time("2022-01-02 01:00:00"), str_to_data_time(""), - str_to_data_time("2022-07-08 03:00:00")}; + Array vec = {str_to_date_time("2022-01-02 01:00:00"), str_to_date_time(""), + str_to_date_time("2022-07-08 03:00:00")}; DataSet data_set = {{{vec, Int64(0)}, Null()}, - {{vec, Int64(1)}, str_to_data_time("2022-01-02 01:00:00")}, + {{vec, Int64(1)}, str_to_date_time("2022-01-02 01:00:00")}, {{vec, Int64(4)}, Null()}, - {{vec, Int64(-1)}, str_to_data_time("2022-07-08 03:00:00")}, - {{vec, Int64(-2)}, str_to_data_time("")}, + {{vec, Int64(-1)}, str_to_date_time("2022-07-08 03:00:00")}, + {{vec, Int64(-2)}, str_to_date_time("")}, {{vec, Int64(-4)}, Null()}, {{Null(), Int64(1)}, Null()}, {{empty_arr, Int64(0)}, Null()}, @@ -109,13 +109,13 @@ TEST(function_array_element_test, element_at) { { InputTypeSet input_types = {TypeIndex::Array, TypeIndex::Date, TypeIndex::Int64}; - Array vec = {str_to_data_time("2022-01-02"), str_to_data_time(""), - str_to_data_time("2022-07-08")}; + Array vec = {str_to_date_time("2022-01-02"), str_to_date_time(""), + str_to_date_time("2022-07-08")}; DataSet data_set = {{{vec, Int64(0)}, Null()}, - {{vec, Int64(1)}, str_to_data_time("2022-01-02")}, + {{vec, Int64(1)}, str_to_date_time("2022-01-02")}, {{vec, Int64(4)}, Null()}, - {{vec, Int64(-1)}, str_to_data_time("2022-07-08")}, - {{vec, Int64(-2)}, str_to_data_time("")}, + {{vec, Int64(-1)}, str_to_date_time("2022-07-08")}, + {{vec, Int64(-2)}, str_to_date_time("")}, {{vec, Int64(-4)}, Null()}, {{Null(), Int64(1)}, Null()}, {{empty_arr, Int64(0)}, Null()}, diff --git a/be/test/vec/function/function_array_index_test.cpp b/be/test/vec/function/function_array_index_test.cpp index c1a0231a7d40e8..6584c69a7500a9 100644 --- a/be/test/vec/function/function_array_index_test.cpp +++ b/be/test/vec/function/function_array_index_test.cpp @@ -113,8 +113,8 @@ TEST(function_array_index_test, array_contains) { { InputTypeSet input_types = {TypeIndex::Array, TypeIndex::Date, TypeIndex::Date}; - Array vec = {str_to_data_time("2022-01-02", false), str_to_data_time("", false), - str_to_data_time("2022-07-08", false)}; + Array vec = {str_to_date_time("2022-01-02", false), str_to_date_time("", false), + str_to_date_time("2022-07-08", false)}; DataSet data_set = {{{vec, std::string("2022-01-02")}, UInt8(1)}, {{vec, std::string("")}, UInt8(1)}, {{vec, std::string("2022-01-03")}, UInt8(0)}, @@ -128,8 +128,8 @@ TEST(function_array_index_test, array_contains) { { InputTypeSet input_types = {TypeIndex::Array, TypeIndex::DateTime, TypeIndex::DateTime}; - Array vec = {str_to_data_time("2022-01-02 00:00:00"), str_to_data_time(""), - str_to_data_time("2022-07-08 00:00:00")}; + Array vec = {str_to_date_time("2022-01-02 00:00:00"), str_to_date_time(""), + str_to_date_time("2022-07-08 00:00:00")}; DataSet data_set = {{{vec, std::string("2022-01-02 00:00:00")}, UInt8(1)}, {{vec, std::string("")}, UInt8(1)}, {{vec, std::string("2022-01-03 00:00:00")}, UInt8(0)}, @@ -215,8 +215,8 @@ TEST(function_array_index_test, array_position) { { InputTypeSet input_types = {TypeIndex::Array, TypeIndex::Date, TypeIndex::Date}; - Array vec = {str_to_data_time("2022-01-02", false), str_to_data_time("", false), - str_to_data_time("2022-07-08", false)}; + Array vec = {str_to_date_time("2022-01-02", false), str_to_date_time("", false), + str_to_date_time("2022-07-08", false)}; DataSet data_set = {{{vec, std::string("2022-01-02")}, Int64(1)}, {{vec, std::string("")}, Int64(2)}, {{vec, std::string("2022-01-03")}, Int64(0)}, @@ -230,8 +230,8 @@ TEST(function_array_index_test, array_position) { { InputTypeSet input_types = {TypeIndex::Array, TypeIndex::DateTime, TypeIndex::DateTime}; - Array vec = {str_to_data_time("2022-01-02 00:00:00"), str_to_data_time(""), - str_to_data_time("2022-07-08 00:00:00")}; + Array vec = {str_to_date_time("2022-01-02 00:00:00"), str_to_date_time(""), + str_to_date_time("2022-07-08 00:00:00")}; DataSet data_set = {{{vec, std::string("2022-01-02 00:00:00")}, Int64(1)}, {{vec, std::string("")}, Int64(2)}, {{vec, std::string("2022-01-03 00:00:00")}, Int64(0)}, diff --git a/be/test/vec/function/function_ifnull_test.cpp b/be/test/vec/function/function_ifnull_test.cpp index 1d1379d45715fb..f7507de3e55f43 100644 --- a/be/test/vec/function/function_ifnull_test.cpp +++ b/be/test/vec/function/function_ifnull_test.cpp @@ -57,9 +57,9 @@ TEST(IfNullTest, String_Int_Test) { std::string func_name = "ifnull"; InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::DateTime}; DataSet data_set = {{{std::string("2021-10-24 12:32:31"), std::string("2021-10-24 13:00:01")}, - str_to_data_time("2021-10-24 12:32:31")}, + str_to_date_time("2021-10-24 12:32:31")}, {{Null(), std::string("2021-10-24 13:00:01")}, - str_to_data_time("2021-10-24 13:00:01")}}; + str_to_date_time("2021-10-24 13:00:01")}}; check_function(func_name, input_types, data_set); } diff --git a/be/test/vec/function/function_nullif_test.cpp b/be/test/vec/function/function_nullif_test.cpp index b750520383c1a4..da37f4e54e09c3 100644 --- a/be/test/vec/function/function_nullif_test.cpp +++ b/be/test/vec/function/function_nullif_test.cpp @@ -48,10 +48,10 @@ TEST(NullIfTest, String_Int_Test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::DateTime}; DataSet data_set = { {{std::string("2021-10-24 12:32:31"), std::string("2021-10-24 13:00:01")}, - str_to_data_time("2021-10-24 12:32:31")}, + str_to_date_time("2021-10-24 12:32:31")}, {{std::string("2021-10-24 13:00:01"), std::string("2021-10-24 13:00:01")}, Null()}, {{std::string("2021-10-24 13:00:01"), Null()}, - str_to_data_time("2021-10-24 13:00:01")}}; + str_to_date_time("2021-10-24 13:00:01")}}; check_function(func_name, input_types, data_set); } diff --git a/be/test/vec/function/function_string_test.cpp b/be/test/vec/function/function_string_test.cpp index 94e877e2ac71ec..9a2d350285deb6 100644 --- a/be/test/vec/function/function_string_test.cpp +++ b/be/test/vec/function/function_string_test.cpp @@ -1011,13 +1011,13 @@ TEST(function_string_test, function_str_to_date_test) { DataSet data_set = { {{Null(), std::string("%Y-%m-%d %H:%i:%s")}, {Null()}}, {{std::string("2014-12-21 12:34:56"), std::string("%Y-%m-%d %H:%i:%s")}, - str_to_data_time("2014-12-21 12:34:56", false)}, + str_to_date_time("2014-12-21 12:34:56", false)}, {{std::string("2014-12-21 12:34%3A56"), std::string("%Y-%m-%d %H:%i%%3A%s")}, - str_to_data_time("2014-12-21 12:34:56", false)}, + str_to_date_time("2014-12-21 12:34:56", false)}, {{std::string("11/09/2011"), std::string("%m/%d/%Y")}, - str_to_data_time("2011-11-09", false)}, + str_to_date_time("2011-11-09", false)}, {{std::string("2020-09-01"), std::string("%Y-%m-%d %H:%i:%s")}, - str_to_data_time("2020-09-01 00:00:00", false)}}; + str_to_date_time("2020-09-01 00:00:00", false)}}; check_function(func_name, input_types, data_set); } diff --git a/be/test/vec/function/function_test_util.cpp b/be/test/vec/function/function_test_util.cpp index 2d8ef33feea581..2de0fb67dbe7ec 100644 --- a/be/test/vec/function/function_test_util.cpp +++ b/be/test/vec/function/function_test_util.cpp @@ -18,7 +18,7 @@ #include "vec/function/function_test_util.h" namespace doris::vectorized { -int64_t str_to_data_time(std::string datetime_str, bool data_time) { +int64_t str_to_date_time(std::string datetime_str, bool data_time) { VecDateTimeValue v; v.from_date_str(datetime_str.c_str(), datetime_str.size()); if (data_time) { //bool data_time only to simplifly means data_time or data to cast, just use in time-functions uint test diff --git a/be/test/vec/function/function_test_util.h b/be/test/vec/function/function_test_util.h index 8765ec83fb61e8..2d8f4605d39a04 100644 --- a/be/test/vec/function/function_test_util.h +++ b/be/test/vec/function/function_test_util.h @@ -42,7 +42,7 @@ using InputDataSet = std::vector>; // without result using DataSet = std::vector, std::any>>; using InputTypeSet = std::vector; -int64_t str_to_data_time(std::string datetime_str, bool data_time = true); +int64_t str_to_date_time(std::string datetime_str, bool data_time = true); namespace ut_type { using TINYINT = int8_t; diff --git a/be/test/vec/function/function_time_test.cpp b/be/test/vec/function/function_time_test.cpp index 9d2f935384ba66..27c7b424cc742a 100644 --- a/be/test/vec/function/function_time_test.cpp +++ b/be/test/vec/function/function_time_test.cpp @@ -248,8 +248,8 @@ TEST(VTimestampFunctionsTest, years_add_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-05-23 00:00:00"), 5}, str_to_data_time("2025-05-23 00:00:00")}, - {{std::string("2020-05-23 00:00:00"), -5}, str_to_data_time("2015-05-23 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), 5}, str_to_date_time("2025-05-23 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), -5}, str_to_date_time("2015-05-23 00:00:00")}, {{std::string(""), 5}, Null()}, {{std::string("2020-05-23 00:00:00"), 8000}, Null()}, {{Null(), 5}, Null()}}; @@ -263,8 +263,8 @@ TEST(VTimestampFunctionsTest, years_sub_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-05-23 00:00:00"), 5}, str_to_data_time("2015-05-23 00:00:00")}, - {{std::string("2020-05-23 00:00:00"), -5}, str_to_data_time("2025-05-23 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), 5}, str_to_date_time("2015-05-23 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), -5}, str_to_date_time("2025-05-23 00:00:00")}, {{std::string(""), 5}, Null()}, {{std::string("2020-05-23 00:00:00"), 3000}, Null()}, {{Null(), 5}, Null()}}; @@ -278,10 +278,10 @@ TEST(VTimestampFunctionsTest, months_add_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-10-23 00:00:00"), -4}, str_to_data_time("2020-06-23 00:00:00")}, - {{std::string("2020-05-23 00:00:00"), 4}, str_to_data_time("2020-09-23 00:00:00")}, + {{std::string("2020-10-23 00:00:00"), -4}, str_to_date_time("2020-06-23 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), 4}, str_to_date_time("2020-09-23 00:00:00")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 00:00:00"), 10}, str_to_data_time("2021-03-23 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), 10}, str_to_date_time("2021-03-23 00:00:00")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -293,10 +293,10 @@ TEST(VTimestampFunctionsTest, months_sub_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-05-23 00:00:00"), 4}, str_to_data_time("2020-01-23 00:00:00")}, - {{std::string("2020-05-23 00:00:00"), -4}, str_to_data_time("2020-09-23 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), 4}, str_to_date_time("2020-01-23 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), -4}, str_to_date_time("2020-09-23 00:00:00")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 00:00:00"), 10}, str_to_data_time("2019-07-23 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), 10}, str_to_date_time("2019-07-23 00:00:00")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -308,10 +308,10 @@ TEST(VTimestampFunctionsTest, days_add_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-10-23 00:00:00"), -4}, str_to_data_time("2020-10-19 00:00:00")}, - {{std::string("2020-05-23 00:00:00"), 4}, str_to_data_time("2020-05-27 00:00:00")}, + {{std::string("2020-10-23 00:00:00"), -4}, str_to_date_time("2020-10-19 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), 4}, str_to_date_time("2020-05-27 00:00:00")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 00:00:00"), 10}, str_to_data_time("2020-06-2 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), 10}, str_to_date_time("2020-06-2 00:00:00")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -323,10 +323,10 @@ TEST(VTimestampFunctionsTest, days_sub_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-05-23 00:00:00"), 4}, str_to_data_time("2020-05-19 00:00:00")}, - {{std::string("2020-05-23 00:00:00"), -4}, str_to_data_time("2020-05-27 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), 4}, str_to_date_time("2020-05-19 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), -4}, str_to_date_time("2020-05-27 00:00:00")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 00:00:00"), 31}, str_to_data_time("2020-04-22 00:00:00")}, + {{std::string("2020-05-23 00:00:00"), 31}, str_to_date_time("2020-04-22 00:00:00")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -338,10 +338,10 @@ TEST(VTimestampFunctionsTest, hours_add_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-10-23 10:00:00"), -4}, str_to_data_time("2020-10-23 06:00:00")}, - {{std::string("2020-05-23 10:00:00"), 4}, str_to_data_time("2020-05-23 14:00:00")}, + {{std::string("2020-10-23 10:00:00"), -4}, str_to_date_time("2020-10-23 06:00:00")}, + {{std::string("2020-05-23 10:00:00"), 4}, str_to_date_time("2020-05-23 14:00:00")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 10:00:00"), 100}, str_to_data_time("2020-05-27 14:00:00")}, + {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2020-05-27 14:00:00")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -353,10 +353,10 @@ TEST(VTimestampFunctionsTest, hours_sub_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-05-23 10:00:00"), 4}, str_to_data_time("2020-05-23 06:00:00")}, - {{std::string("2020-05-23 10:00:00"), -4}, str_to_data_time("2020-05-23 14:00:00")}, + {{std::string("2020-05-23 10:00:00"), 4}, str_to_date_time("2020-05-23 06:00:00")}, + {{std::string("2020-05-23 10:00:00"), -4}, str_to_date_time("2020-05-23 14:00:00")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 10:00:00"), 31}, str_to_data_time("2020-05-22 03:00:00")}, + {{std::string("2020-05-23 10:00:00"), 31}, str_to_date_time("2020-05-22 03:00:00")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -368,10 +368,10 @@ TEST(VTimestampFunctionsTest, minutes_add_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-10-23 10:00:00"), 40}, str_to_data_time("2020-10-23 10:40:00")}, - {{std::string("2020-05-23 10:00:00"), -40}, str_to_data_time("2020-05-23 09:20:00")}, + {{std::string("2020-10-23 10:00:00"), 40}, str_to_date_time("2020-10-23 10:40:00")}, + {{std::string("2020-05-23 10:00:00"), -40}, str_to_date_time("2020-05-23 09:20:00")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 10:00:00"), 100}, str_to_data_time("2020-05-23 11:40:00")}, + {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2020-05-23 11:40:00")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -383,10 +383,10 @@ TEST(VTimestampFunctionsTest, minutes_sub_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-05-23 10:00:00"), 40}, str_to_data_time("2020-05-23 09:20:00")}, - {{std::string("2020-05-23 10:00:00"), -40}, str_to_data_time("2020-05-23 10:40:00")}, + {{std::string("2020-05-23 10:00:00"), 40}, str_to_date_time("2020-05-23 09:20:00")}, + {{std::string("2020-05-23 10:00:00"), -40}, str_to_date_time("2020-05-23 10:40:00")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 10:00:00"), 100}, str_to_data_time("2020-05-23 08:20:00")}, + {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2020-05-23 08:20:00")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -398,10 +398,10 @@ TEST(VTimestampFunctionsTest, seconds_add_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-10-23 10:00:00"), 40}, str_to_data_time("2020-10-23 10:00:40")}, - {{std::string("2020-05-23 10:00:00"), -40}, str_to_data_time("2020-05-23 09:59:20")}, + {{std::string("2020-10-23 10:00:00"), 40}, str_to_date_time("2020-10-23 10:00:40")}, + {{std::string("2020-05-23 10:00:00"), -40}, str_to_date_time("2020-05-23 09:59:20")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 10:00:00"), 100}, str_to_data_time("2020-05-23 10:01:40")}, + {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2020-05-23 10:01:40")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -413,10 +413,10 @@ TEST(VTimestampFunctionsTest, seconds_sub_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-05-23 10:00:00"), 40}, str_to_data_time("2020-05-23 09:59:20")}, - {{std::string("2020-05-23 10:00:00"), -40}, str_to_data_time("2020-05-23 10:00:40")}, + {{std::string("2020-05-23 10:00:00"), 40}, str_to_date_time("2020-05-23 09:59:20")}, + {{std::string("2020-05-23 10:00:00"), -40}, str_to_date_time("2020-05-23 10:00:40")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 10:00:00"), 100}, str_to_data_time("2020-05-23 09:58:20")}, + {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2020-05-23 09:58:20")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -428,10 +428,10 @@ TEST(VTimestampFunctionsTest, weeks_add_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-10-23 10:00:00"), 5}, str_to_data_time("2020-11-27 10:00:00")}, - {{std::string("2020-05-23 10:00:00"), -5}, str_to_data_time("2020-04-18 10:00:00")}, + {{std::string("2020-10-23 10:00:00"), 5}, str_to_date_time("2020-11-27 10:00:00")}, + {{std::string("2020-05-23 10:00:00"), -5}, str_to_date_time("2020-04-18 10:00:00")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 10:00:00"), 100}, str_to_data_time("2022-04-23 10:00:00")}, + {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2022-04-23 10:00:00")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -443,10 +443,10 @@ TEST(VTimestampFunctionsTest, weeks_sub_test) { InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::Int32}; DataSet data_set = { - {{std::string("2020-05-23 10:00:00"), 5}, str_to_data_time("2020-04-18 10:00:00")}, - {{std::string("2020-05-23 10:00:00"), -5}, str_to_data_time("2020-6-27 10:00:00")}, + {{std::string("2020-05-23 10:00:00"), 5}, str_to_date_time("2020-04-18 10:00:00")}, + {{std::string("2020-05-23 10:00:00"), -5}, str_to_date_time("2020-6-27 10:00:00")}, {{std::string(""), 4}, Null()}, - {{std::string("2020-05-23 10:00:00"), 100}, str_to_data_time("2018-06-23 10:00:00")}, + {{std::string("2020-05-23 10:00:00"), 100}, str_to_date_time("2018-06-23 10:00:00")}, {{Null(), 4}, Null()}}; check_function(func_name, input_types, data_set); @@ -471,10 +471,10 @@ TEST(VTimestampFunctionsTest, date_test) { InputTypeSet input_types = {TypeIndex::DateTime}; DataSet data_set = { - {{std::string("2021-01-01 06:00:00")}, str_to_data_time("2021-01-01", false)}, + {{std::string("2021-01-01 06:00:00")}, str_to_date_time("2021-01-01", false)}, {{std::string("")}, Null()}, {{Null()}, Null()}, - {{std::string("0000-01-01 00:00:00")}, str_to_data_time("0000-01-01", false)}}; + {{std::string("0000-01-01 00:00:00")}, str_to_date_time("0000-01-01", false)}}; check_function(func_name, input_types, data_set); } @@ -522,9 +522,9 @@ TEST(VTimestampFunctionsTest, makedate_test) { InputTypeSet input_types = {TypeIndex::Int32, TypeIndex::Int32}; - DataSet data_set = {{{2021, 3}, str_to_data_time("2021-01-03", false)}, - {{2021, 95}, str_to_data_time("2021-04-05", false)}, - {{2021, 400}, str_to_data_time("2022-02-04", false)}, + DataSet data_set = {{{2021, 3}, str_to_date_time("2021-01-03", false)}, + {{2021, 95}, str_to_date_time("2021-04-05", false)}, + {{2021, 400}, str_to_date_time("2022-02-04", false)}, {{2021, 0}, Null()}, {{2021, -10}, Null()}, {{-1, 3}, Null()}, @@ -541,9 +541,9 @@ TEST(VTimestampFunctionsTest, convert_tz_test) { DataSet data_set = { {{DATETIME("2019-08-01 13:21:03"), STRING("Asia/Shanghai"), STRING("America/Los_Angeles")}, - str_to_data_time("2019-07-31 22:21:03", true)}, + str_to_date_time("2019-07-31 22:21:03", true)}, {{DATETIME("2019-08-01 13:21:03"), STRING("+08:00"), STRING("America/Los_Angeles")}, - str_to_data_time("2019-07-31 22:21:03", true)}}; + str_to_date_time("2019-07-31 22:21:03", true)}}; check_function(func_name, input_types, data_set); }