Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel39 committed May 22, 2024
1 parent 36b63ce commit 9193e08
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 34 deletions.
2 changes: 1 addition & 1 deletion be/test/vec/data_types/from_string_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ TEST(FromStringTest, ScalaWrapperFieldVsDataType) {
"12345678901234567.012345677", "12345678901234567.012345677",
"999999999999999999.999999999"},
{"12345678901234567.012345678", "123456789012345678.012345670",
"12345678901234567.012345678", "", ""}),
"12345678901234567.012345678", "12345678901234567.012345678", ""}),
// decimal32 ==> decimal32(9,2)
FieldType_RandStr(FieldType::OLAP_FIELD_TYPE_DECIMAL32,
// (7,2) (6,3) (7,3) (8,1)
Expand Down
31 changes: 16 additions & 15 deletions be/test/vec/data_types/serde/data_type_serde_csv_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,22 @@ TEST(CsvSerde, ScalaDataTypeSerdeCsvTest) {
FieldType_RandStr(FieldType::OLAP_FIELD_TYPE_STRING, {"doris be better"},
{"doris be better"}),
// decimal ==> decimalv2(decimal<128>(27,9))
FieldType_RandStr(FieldType::OLAP_FIELD_TYPE_DECIMAL,
{
// (17, 9)(first 0 will ignore)
"012345678901234567.012345678",
// (18, 8) (automatically fill 0 for scala)
"123456789012345678.01234567",
// (17, 10) (rounding last to make it fit)
"12345678901234567.0123456779",
// (17, 11) (rounding last to make it fit)
"12345678901234567.01234567791",
// (19, 8) (wrong)
"1234567890123456789.01234567",
},
{"12345678901234567.012345678", "123456789012345678.012345670",
"12345678901234567.012345678", "", ""}),
FieldType_RandStr(
FieldType::OLAP_FIELD_TYPE_DECIMAL,
{
// (17, 9)(first 0 will ignore)
"012345678901234567.012345678",
// (18, 8) (automatically fill 0 for scala)
"123456789012345678.01234567",
// (17, 10) (rounding last to make it fit)
"12345678901234567.0123456779",
// (17, 11) (rounding last to make it fit)
"12345678901234567.01234567791",
// (19, 8) (wrong)
"1234567890123456789.01234567",
},
{"12345678901234567.012345678", "123456789012345678.012345670",
"12345678901234567.012345678", "12345678901234567.012345678", ""}),
// decimal32 ==> decimal32(9,2) (7,2) (6,3) (7,3) (8,1)
FieldType_RandStr(FieldType::OLAP_FIELD_TYPE_DECIMAL32,
{"1234567.12", "123456.123", "1234567.123", "12345679.1"},
Expand Down
37 changes: 19 additions & 18 deletions be/test/vec/data_types/serde/data_type_serde_text_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,22 @@ TEST(TextSerde, ScalaDataTypeSerdeTextTest) {
FieldType_RandStr(FieldType::OLAP_FIELD_TYPE_STRING, {"doris be better"},
{"doris be better"}),
// decimal ==> decimalv2(decimal<128>(27,9))
FieldType_RandStr(FieldType::OLAP_FIELD_TYPE_DECIMAL,
{
// (17, 9)(first 0 will ignore)
"012345678901234567.012345678",
// (18, 8) (automatically fill 0 for scala)
"123456789012345678.01234567",
// (17, 10) (rounding last to make it fit)
"12345678901234567.0123456779",
// (17, 11) (rounding last to make it fit)
"12345678901234567.01234567791",
// (19, 8) (wrong)
"1234567890123456789.01234567",
},
{"12345678901234567.012345678", "123456789012345678.012345670",
"12345678901234567.012345678", "", ""}),
FieldType_RandStr(
FieldType::OLAP_FIELD_TYPE_DECIMAL,
{
// (17, 9)(first 0 will ignore)
"012345678901234567.012345678",
// (18, 8) (automatically fill 0 for scala)
"123456789012345678.01234567",
// (17, 10) (rounding last to make it fit)
"12345678901234567.0123456779",
// (17, 11) (rounding last to make it fit)
"12345678901234567.01234567791",
// (19, 8) (wrong)
"1234567890123456789.01234567",
},
{"12345678901234567.012345678", "123456789012345678.012345670",
"12345678901234567.012345678", "12345678901234567.012345678", ""}),
// decimal32 ==> decimal32(9,2) (7,2) (6,3) (7,3) (8,1)
FieldType_RandStr(FieldType::OLAP_FIELD_TYPE_DECIMAL32,
{"1234567.12", "123456.123", "1234567.123", "12345679.1"},
Expand Down Expand Up @@ -429,13 +430,13 @@ TEST(TextSerde, ComplexTypeSerdeTextTest) {
"[\\1234567890123456789.01234567\\]"},
{"[4.000000000, 5.500000000, 6.670000000]",
"[12345678901234567.012345678, 123456789012345678.012345670, "
"12345678901234567.012345678, null, null]",
"12345678901234567.012345678, 12345678901234567.012345678, null]",
"[null, null, null, null, null]", "[null]"},
{"[4.000000000, 5.500000000, 6.670000000]",
"[12345678901234567.012345678, 123456789012345678.012345670, "
"12345678901234567.012345678, null, null]",
"12345678901234567.012345678, 12345678901234567.012345678, null]",
"[12345678901234567.012345678, 123456789012345678.012345670, "
"12345678901234567.012345678, null, null]",
"12345678901234567.012345678, 12345678901234567.012345678, null]",
"[null]"}),
};
// array type
Expand Down

0 comments on commit 9193e08

Please sign in to comment.