eldenmoon commented on code in PR #27145:
URL: https://github.com/apache/doris/pull/27145#discussion_r1432174063


##########
be/src/vec/exec/format/json/new_json_reader.cpp:
##########
@@ -1279,16 +1298,14 @@ Status 
NewJsonReader::_simdjson_handle_nested_complex_json(
                 // so that the caller will continue reading next line.
                 *is_empty_row = true;
             }
-            break; // read a valid row
-        } catch (simdjson::simdjson_error& e) {
-            RETURN_IF_ERROR(_handle_simdjson_error(e, block, num_rows, eof));
-            if (*_scanner_eof) {
-                // When _scanner_eof is true and valid is false, it means that 
we have encountered
-                // unqualified data and decided to stop the scan.
-                *is_empty_row = true;
-                return Status::OK();
-            }
-            continue;
+        }

Review Comment:
   why remove this break?



##########
be/src/vec/exec/format/json/new_json_reader.cpp:
##########
@@ -1236,20 +1249,26 @@ Status 
NewJsonReader::_simdjson_handle_nested_complex_json(
         RuntimeState* /*state*/, Block& block, const 
std::vector<SlotDescriptor*>& slot_descs,
         bool* is_empty_row, bool* eof) {
     // nested complex json
-    while (true) {
-        size_t num_rows = block.rows();
-        simdjson::ondemand::object cur;
-        size_t size = 0;
-        simdjson::error_code error;
-        try {
-            RETURN_IF_ERROR(_simdjson_parse_json(&size, is_empty_row, eof, 
&error));
-            if (size == 0 || *eof) {
-                *is_empty_row = true;
-                return Status::OK();
+    size_t num_rows = block.rows();
+    simdjson::ondemand::object cur;
+    size_t size = 0;
+    simdjson::error_code error;
+
+    try {
+        RETURN_IF_ERROR(_simdjson_parse_json(&size, is_empty_row, eof, 
&error));
+        if (size == 0 || *eof) {
+            *is_empty_row = true;
+            return Status::OK();
+        }
+
+        for (_json_stream_iterator = _json_stream.begin();
+             _json_stream_iterator != _json_stream.end(); 
++_json_stream_iterator) {
+            if (_json_stream_iterator.current_index() >= _original_doc_size) {
+                break;
             }
             Status st = _get_json_value(&size, eof, &error, is_empty_row);
             if (st.is<DATA_QUALITY_ERROR>()) {
-                continue; // continue to read next
+                return Status::OK();

Review Comment:
   why return OK instead of read next?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to