yangzhg commented on code in PR #12601:
URL: https://github.com/apache/doris/pull/12601#discussion_r970709479


##########
be/src/vec/exec/vjson_scanner.cpp:
##########
@@ -273,12 +273,29 @@ Status VJsonReader::_set_column_value(rapidjson::Value& 
objectValue,
             }
         }
     }
-
-    if (nullcount == slot_descs.size()) {
+    if (!has_valid_value) {
         RETURN_IF_ERROR(_append_error_msg(objectValue, "All fields is null, 
this is a invalid row.",
                                           "", valid));
         return Status::OK();
     }
+    ctx_idx = 0;
+    int nullcount = 0;
+    // fill missing slot
+    for (auto slot_desc : slot_descs) {
+        if (!slot_desc->is_materialized()) {
+            continue;
+        }
+        int dest_index = ctx_idx++;
+        auto* column_ptr = columns[dest_index].get();
+        if (column_ptr->size() < cur_row_count + 1) {
+            assert(column_ptr->size() == cur_row_count);
+            column_ptr->assume_mutable()->insert_default();
+            ++nullcount;
+        }
+        assert(column_ptr->size() == cur_row_count + 1);
+    }
+    // There is at least one valid value here
+    assert(nullcount < columns.size());

Review Comment:
   not use assert



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