[Chore](build) enchancement for backend build time usage (#18344)

This commit is contained in:
Pxl
2023-04-06 11:13:21 +08:00
committed by GitHub
parent 4ca0c0face
commit 76d76f672c
21 changed files with 193 additions and 414 deletions

View File

@ -852,51 +852,6 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
check_function<DataTypeTime, true>(func_name, input_types, data_set);
}
{
InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Date};
DataSet data_set = {{{std::string("2019-07-18"), std::string("2019-07-18")}, 0.0},
{{std::string("2019-07-18"), std::string("2019-07-18")}, -0.0},
{{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);
}
{
InputTypeSet input_types = {TypeIndex::Date, TypeIndex::DateV2};
DataSet data_set = {{{std::string("2019-07-18"), std::string("2019-07-18")}, 0.0},
{{std::string("2019-07-18"), std::string("2019-07-18")}, -0.0},
{{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);
}
{
InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::DateV2};
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:00"), std::string("2019-07-18")}, -0.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<DataTypeTime, true>(func_name, input_types, data_set);
}
{
InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::DateTime};
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:00")}, -0.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<DataTypeTime, true>(func_name, input_types, data_set);
}
{
InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::DateTimeV2};
@ -908,57 +863,6 @@ TEST(VTimestampFunctionsTest, timediff_v2_test) {
check_function<DataTypeTime, true>(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<DataTypeTime, true>(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<DataTypeTime, true>(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<DataTypeTime, true>(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<DataTypeTime, true>(func_name, input_types, data_set);
}
}
TEST(VTimestampFunctionsTest, datediff_v2_test) {
@ -975,52 +879,6 @@ TEST(VTimestampFunctionsTest, datediff_v2_test) {
check_function<DataTypeInt32, true>(func_name, input_types, data_set);
}
{
InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::Date};
DataSet data_set = {{{std::string("2019-07-18"), std::string("2019-07-19")}, -1},
{{std::string("2019-07-18"), std::string("2019-07-17")}, 1},
{{std::string("2019-00-18"), std::string("2019-07-18")}, Null()},
{{std::string("2019-07-18"), std::string("2019-07-00")}, Null()}};
check_function<DataTypeInt32, true>(func_name, input_types, data_set);
}
{
InputTypeSet input_types = {TypeIndex::Date, TypeIndex::DateV2};
DataSet data_set = {{{std::string("2019-07-18"), std::string("2019-07-19")}, -1},
{{std::string("2019-07-18"), std::string("2019-07-17")}, 1},
{{std::string("2019-00-18"), std::string("2019-07-18")}, Null()},
{{std::string("2019-07-18"), std::string("2019-07-00")}, Null()}};
check_function<DataTypeInt32, true>(func_name, input_types, data_set);
}
{
InputTypeSet input_types = {TypeIndex::DateTime, TypeIndex::DateV2};
DataSet data_set = {
{{std::string("2019-07-18 00:00:00"), std::string("2019-07-19")}, -1},
{{std::string("2019-07-18 00:00:00"), std::string("2019-07-17")}, 1},
{{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<DataTypeInt32, true>(func_name, input_types, data_set);
}
{
InputTypeSet input_types = {TypeIndex::DateV2, TypeIndex::DateTime};
DataSet data_set = {
{{std::string("2019-07-18"), std::string("2019-07-19 00:00:00")}, -1},
{{std::string("2019-07-18"), std::string("2019-07-17 00:00:00")}, 1},
{{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<DataTypeInt32, true>(func_name, input_types, data_set);
}
{
InputTypeSet input_types = {TypeIndex::DateTimeV2, TypeIndex::DateV2};
@ -1032,58 +890,6 @@ TEST(VTimestampFunctionsTest, datediff_v2_test) {
check_function<DataTypeInt32, true>(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<DataTypeInt32, true>(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<DataTypeInt32, true>(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<DataTypeInt32, true>(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<DataTypeInt32, true>(func_name, input_types, data_set);
}
}
TEST(VTimestampFunctionsTest, date_format_v2_test) {