Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions be/src/vec/data_types/serde/data_type_datetimev2_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ Status DataTypeDateTimeV2SerDe::deserialize_one_cell_from_json(IColumn& column,
}

} else if (ReadBuffer rb(slice.data, slice.size);
!read_datetime_v2_text_impl<UInt64>(val, rb)) {
return Status::InvalidDataFormat("parse date fail, string: '{}'",
std::string(rb.position(), rb.count()).c_str());
!read_datetime_v2_text_impl<UInt64>(val, rb, scale)) {
return Status::InvalidArgument("parse date fail, string: '{}'",
std::string(rb.position(), rb.count()).c_str());
}
column_data.insert_value(val);
return Status::OK();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
3|"2022-12-01 22:23:24.999999"|22.6789|33.6789|["2022-12-01 22:23:24.999999","2022-12-01 23:23:24.999999"]|[22.6789,33.6789]|[22.6789,33.6789]
4|"2022-12-02 22:23:24.999999"|23.6789|34.6789|["2022-12-02 22:23:24.999999","2022-12-02 23:23:24.999999"]|[23.6789,34.6789]|[22.6789,34.6789]
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
2022-12-02T22:23:24.999

-- !select --
2022-12-01T22:23:25
2022-12-02T22:23:25
2022-12-01T22:23:24.999
2022-12-02T22:23:24.999

Expand All @@ -16,6 +18,8 @@
2022-12-02T22:23:24.999

-- !select --
2022-12-01T23:23:25
2022-12-02T23:23:25
2022-12-01T23:23:24.999
2022-12-02T23:23:24.999

Expand All @@ -31,10 +35,14 @@
-- !select --
22.679
23.679
22.679
23.679

-- !select --
22.679
22.679
22.679
22.679

-- !select --
23
Expand All @@ -48,139 +56,203 @@
-- !select --
33.679
34.679
33.679
34.679

-- !select --
33.679
34.679
33.679
34.679

-- !select --
[22.679]
[23.679]
[22.679]
[23.679]

-- !select --
[24.990, 25.990]
[24.990, 25.990]
[24.990, 25.990]
[24.990, 25.990]

-- !select --
[24.990, 25.990]

-- !select --
[33.679]
[34.679]
[33.679]
[34.679]

-- !select --
[24.990, 25.990]
[24.990, 25.990]
[24.990, 25.990]
[24.990, 25.990]

-- !select --
[24.990, 25.990]

-- !select --
[null]
[null]
["2022-12-01 22:23:24.999"]
["2022-12-02 22:23:24.999"]

-- !select --
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]

-- !select --
[2022-12-02 22:23:24.999, 2022-12-02 22:23:23.997]

-- !select --
[]
[]
[]
[]

-- !select --
["2022-12-01 22:23:25.000", "2022-12-01 23:23:25.000"]
["2022-12-02 22:23:25.000", "2022-12-02 23:23:25.000"]
["2022-12-01 22:23:24.999", "2022-12-01 23:23:24.999"]
["2022-12-02 22:23:24.999", "2022-12-02 23:23:24.999"]

-- !select --
\N
\N
\N
\N

-- !select --
[22.679]
[]
[22.679]
[]

-- !select --
[22.679, 33.679]
[23.679, 34.679]
[22.679, 33.679]
[23.679, 34.679]

-- !select --
\N
\N
\N
\N

-- !select --
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]

-- !select --
["2022-12-01 22:23:25.000", "2022-12-01 23:23:25.000"]
["2022-12-02 22:23:25.000", "2022-12-02 23:23:25.000"]
["2022-12-01 22:23:24.999", "2022-12-01 23:23:24.999"]
["2022-12-02 22:23:24.999", "2022-12-02 23:23:24.999"]

-- !select --
["2022-12-01 22:23:25.000", "2022-12-01 23:23:25.000", "2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:25.000", "2022-12-02 23:23:25.000", "2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-01 22:23:24.999", "2022-12-01 23:23:24.999", "2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 23:23:24.999", "2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]

-- !select --
[22.679, 33.679, 22.679, 33.679, 22.679, 33.679]
[23.679, 34.679, 23.679, 34.679, 23.679, 34.679]
[22.679, 33.679, 22.679, 33.679, 22.679, 33.679]
[23.679, 34.679, 23.679, 34.679, 23.679, 34.679]

-- !select --
[{"col": 22.679, "col": 22.679, "col": "2022-12-01 22:23:25.000", "col": 22.679}, {"col": 33.679, "col": 33.679, "col": "2022-12-01 23:23:25.000", "col": 33.679}]
[{"col": 23.679, "col": 23.679, "col": "2022-12-02 22:23:25.000", "col": 23.679}, {"col": 34.679, "col": 34.679, "col": "2022-12-02 23:23:25.000", "col": 34.679}]
[{"col": 22.679, "col": 22.679, "col": "2022-12-01 22:23:24.999", "col": 22.679}, {"col": 33.679, "col": 33.679, "col": "2022-12-01 23:23:24.999", "col": 33.679}]
[{"col": 23.679, "col": 23.679, "col": "2022-12-02 22:23:24.999", "col": 23.679}, {"col": 34.679, "col": 34.679, "col": "2022-12-02 23:23:24.999", "col": 34.679}]

-- !select --
[{"col": "2022-12-02 22:23:24.999"}, {"col": "2022-12-02 22:23:23.997"}]
[{"col": "2022-12-02 22:23:24.999"}, {"col": "2022-12-02 22:23:23.997"}]
[{"col": "2022-12-02 22:23:24.999"}, {"col": "2022-12-02 22:23:23.997"}]
[{"col": "2022-12-02 22:23:24.999"}, {"col": "2022-12-02 22:23:23.997"}]

-- !select --
[{"col": "2022-12-01 22:23:25.000"}, {"col": "2022-12-01 23:23:25.000"}]
[{"col": "2022-12-02 22:23:25.000"}, {"col": "2022-12-02 23:23:25.000"}]
[{"col": "2022-12-01 22:23:24.999"}, {"col": "2022-12-01 23:23:24.999"}]
[{"col": "2022-12-02 22:23:24.999"}, {"col": "2022-12-02 23:23:24.999"}]

-- !select --
[{"col": "2022-12-01 22:23:25.000", "col": "2022-12-02 22:23:24.999"}, {"col": "2022-12-01 23:23:25.000", "col": "2022-12-02 22:23:23.997"}]
[{"col": "2022-12-02 22:23:25.000", "col": "2022-12-02 22:23:24.999"}, {"col": "2022-12-02 23:23:25.000", "col": "2022-12-02 22:23:23.997"}]
[{"col": "2022-12-01 22:23:24.999", "col": "2022-12-02 22:23:24.999"}, {"col": "2022-12-01 23:23:24.999", "col": "2022-12-02 22:23:23.997"}]
[{"col": "2022-12-02 22:23:24.999", "col": "2022-12-02 22:23:24.999"}, {"col": "2022-12-02 23:23:24.999", "col": "2022-12-02 22:23:23.997"}]

-- !select --
["2022-12-02 22:23:23.997", "2022-12-02 22:23:24.999"]
["2022-12-02 22:23:23.997", "2022-12-02 22:23:24.999"]
["2022-12-02 22:23:23.997", "2022-12-02 22:23:24.999"]
["2022-12-02 22:23:23.997", "2022-12-02 22:23:24.999"]

-- !select --
["2023-03-08 23:23:23.997", "2022-12-01 22:23:25.000", "2022-12-01 23:23:25.000"]
["2023-03-08 23:23:23.997", "2022-12-02 22:23:25.000", "2022-12-02 23:23:25.000"]
["2023-03-08 23:23:23.997", "2022-12-01 22:23:24.999", "2022-12-01 23:23:24.999"]
["2023-03-08 23:23:23.997", "2022-12-02 22:23:24.999", "2022-12-02 23:23:24.999"]

-- !select --
\N ["2022-12-01 22:23:25.000", "2022-12-01 23:23:25.000"] [null, "2022-12-01 22:23:25.000", "2022-12-01 23:23:25.000"]
\N ["2022-12-02 22:23:25.000", "2022-12-02 23:23:25.000"] [null, "2022-12-02 22:23:25.000", "2022-12-02 23:23:25.000"]
2022-12-01T22:23:24.999 ["2022-12-01 22:23:24.999", "2022-12-01 23:23:24.999"] ["2022-12-01 22:23:24.999", "2022-12-01 22:23:24.999", "2022-12-01 23:23:24.999"]
2022-12-02T22:23:24.999 ["2022-12-02 22:23:24.999", "2022-12-02 23:23:24.999"] ["2022-12-02 22:23:24.999", "2022-12-02 22:23:24.999", "2022-12-02 23:23:24.999"]

-- !select --
[25.990, 22.679, 33.679]
[25.990, 23.679, 34.679]
[25.990, 22.679, 33.679]
[25.990, 23.679, 34.679]

-- !select --
22.679 [22.679, 33.679] [22.679, 22.679, 33.679]
23.679 [23.679, 34.679] [23.679, 23.679, 34.679]
22.679 [22.679, 33.679] [22.679, 22.679, 33.679]
23.679 [23.679, 34.679] [23.679, 23.679, 34.679]

-- !select --
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 22:23:23.997"]

-- !select --
["2022-12-01 22:23:25.000", "2022-12-01 23:23:25.000", "2023-03-08 23:23:23.997"]
["2022-12-02 22:23:25.000", "2022-12-02 23:23:25.000", "2023-03-08 23:23:23.997"]
["2022-12-01 22:23:24.999", "2022-12-01 23:23:24.999", "2023-03-08 23:23:23.997"]
["2022-12-02 22:23:24.999", "2022-12-02 23:23:24.999", "2023-03-08 23:23:23.997"]

-- !select --
\N ["2022-12-01 22:23:25.000", "2022-12-01 23:23:25.000"] ["2022-12-01 22:23:25.000", "2022-12-01 23:23:25.000", null]
\N ["2022-12-02 22:23:25.000", "2022-12-02 23:23:25.000"] ["2022-12-02 22:23:25.000", "2022-12-02 23:23:25.000", null]
2022-12-01T22:23:24.999 ["2022-12-01 22:23:24.999", "2022-12-01 23:23:24.999"] ["2022-12-01 22:23:24.999", "2022-12-01 23:23:24.999", "2022-12-01 22:23:24.999"]
2022-12-02T22:23:24.999 ["2022-12-02 22:23:24.999", "2022-12-02 23:23:24.999"] ["2022-12-02 22:23:24.999", "2022-12-02 23:23:24.999", "2022-12-02 22:23:24.999"]

-- !select --
[22.679, 33.679, 25.990]
[23.679, 34.679, 25.990]
[22.679, 33.679, 25.990]
[23.679, 34.679, 25.990]

-- !select --
22.679 [22.679, 33.679] [22.679, 33.679, 22.679]
23.679 [23.679, 34.679] [23.679, 34.679, 23.679]
22.679 [22.679, 33.679] [22.679, 33.679, 22.679]
23.679 [23.679, 34.679] [23.679, 34.679, 23.679]

-- !select --
[23, 11]
Expand All @@ -194,4 +266,6 @@
-- !select --
[22.679, 56.358]
[23.679, 58.358]
[22.679, 56.358]
[23.679, 58.358]

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,28 @@ suite("test_array_with_scale_type") {
"storage_format" = "V2"
)
"""
// load with same insert into data
streamLoad {
table "${tableName}"

set 'column_separator', '|'

file 'test_array_with_scale_type.csv'
time 10000 // limit inflight 10s

check { result, exception, startTime, endTime ->
if (exception != null) {
throw exception
}
log.info("Stream load result: ${result}".toString())
def json = parseJson(result)
assertEquals("success", json.Status.toLowerCase())
assertEquals(2, json.NumberTotalRows)
assertEquals(2, json.NumberLoadedRows)
assertEquals(0, json.NumberFilteredRows)
assertEquals(0, json.NumberUnselectedRows)
}
}

sql """INSERT INTO ${tableName} values
(1,"2022-12-01 22:23:24.999999",22.6789,33.6789,["2022-12-01 22:23:24.999999","2022-12-01 23:23:24.999999"],[22.6789,33.6789],[22.6789,33.6789]),
Expand Down