worker24h commented on a change in pull request #4020:
URL: https://github.com/apache/incubator-doris/pull/4020#discussion_r449951165



##########
File path: be/src/exec/json_scanner.cpp
##########
@@ -360,26 +408,31 @@ Status JsonReader::set_tuple_value(rapidjson::Value& 
objectValue, Tuple* tuple,
     }
 
     if (nullcount == slot_descs.size()) {
-        _state->append_error_msg_to_file("", "The all fields is null, this is 
a invalid row.");
+        _state->append_error_msg_to_file(_print_json_value(objectValue), "All 
fields is null, this is a invalid row.");
         _counter->num_rows_filtered++;
         *valid = false;
-        return Status::OK();
+        return;
     }
     *valid = true;
-    return Status::OK();
+    return;
 }
 
 /**
- * handle input a simple json
+ * handle input a simple json.
+ * A json is a simple json only when user not specifying the json path.
  * For example:
  *  case 1. [{"colunm1":"value1", "colunm2":10}, {"colunm1":"value2", 
"colunm2":30}]
  *  case 2. {"colunm1":"value1", "colunm2":10}
  */
-Status JsonReader::handle_simple_json(Tuple* tuple, const 
std::vector<SlotDescriptor*>& slot_descs, MemPool* tuple_pool, bool* eof) {
+Status JsonReader::_handle_simple_json(Tuple* tuple, const 
std::vector<SlotDescriptor*>& slot_descs, MemPool* tuple_pool, bool* eof) {
     do {
         bool valid = false;
         if (_next_line >= _total_lines) {//parse json and generic document
-            RETURN_IF_ERROR(parse_json_doc(eof));
+            Status st = _parse_json_doc(eof);
+            if (st.is_data_quality_error()) {
+                continue; // continue to read next
+            }
+            RETURN_IF_ERROR(st); // terminate if encounter other errors

Review comment:
       I think that this code can be deleted




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to