This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 5edf259ac4b [fix](json) fix be crash while load json data (#34283) 
(#34346)
5edf259ac4b is described below

commit 5edf259ac4b161d9a995ea1d85e87ff12aa848c7
Author: camby <[email protected]>
AuthorDate: Tue Apr 30 16:11:41 2024 +0800

    [fix](json) fix be crash while load json data (#34283) (#34346)
---
 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 b698eb4e2ce..ba7488da4d0 100644
--- a/be/src/vec/exec/format/json/new_json_reader.cpp
+++ b/be/src/vec/exec/format/json/new_json_reader.cpp
@@ -583,7 +583,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]

Reply via email to