This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 9d0d7293f07a7b1d286186d3871b938d9f939636 Author: camby <[email protected]> AuthorDate: Tue Apr 30 11:46:22 2024 +0800 [fix](json) fix be crash while load json data (#34283) --- be/src/vec/exec/format/json/new_json_reader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/be/src/vec/exec/format/json/new_json_reader.cpp b/be/src/vec/exec/format/json/new_json_reader.cpp index 9cfa838b592..5636e242761 100644 --- a/be/src/vec/exec/format/json/new_json_reader.cpp +++ b/be/src/vec/exec/format/json/new_json_reader.cpp @@ -497,7 +497,9 @@ Status NewJsonReader::_vhandle_simple_json(RuntimeState* /*state*/, Block& block objectValue = _json_doc; } _next_row = 0; - if (_fuzzy_parse) { + // Here we expect the incoming `objectValue` to be a Json Object, such as {"key" : "value"} + // If a Json Array comes here, it maybe crashed in it->name.GetString() + if (_fuzzy_parse && objectValue->IsObject()) { for (auto* v : slot_descs) { for (int i = 0; i < objectValue->MemberCount(); ++i) { auto it = objectValue->MemberBegin() + i; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
