[feature](datetime) "timediff" supports calculating microseconds (#21371)

This commit is contained in:
Mryange
2023-07-10 19:21:32 +08:00
committed by GitHub
parent 202a5c636f
commit 8973610543
28 changed files with 518 additions and 21 deletions

View File

@ -859,7 +859,7 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
{{std::string("2019-00-18"), std::string("2019-07-18")}, Null()},
{{std::string("2019-07-18"), std::string("2019-07-00")}, Null()}};
check_function<DataTypeTime, true>(func_name, input_types, data_set);
check_function<DataTypeTimeV2, true>(func_name, input_types, data_set);
}
{
@ -867,11 +867,12 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
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-07-18 00:00:10"), std::string("2019-07-18 00:00:00")},
10000000.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<DataTypeTime, true>(func_name, input_types, data_set);
check_function<DataTypeTimeV2, true>(func_name, input_types, data_set);
}
}