DarvenDuan commented on code in PR #20078:
URL: https://github.com/apache/doris/pull/20078#discussion_r1221104754
##########
be/src/vec/exec/format/json/new_json_reader.cpp:
##########
@@ -832,19 +836,19 @@ Status NewJsonReader::_set_column_value(rapidjson::Value&
objectValue, Block& bl
return Status::OK();
}
has_valid_value = true;
- } else { // not found
- // When the entire row has no valid value, this row should be
filtered,
- // so the default value cannot be directly inserted here
- if (!slot_desc->is_nullable()) {
- RETURN_IF_ERROR(_append_error_msg(
- objectValue,
- "The column `{}` is not nullable, but it's not found
in jsondata.",
- slot_desc->col_name(), valid));
- break;
+ } else {
+ // not found, filling with default value
+ RETURN_IF_ERROR(_fill_missing_column(slot_desc, column_ptr,
valid));
+ if (!(*valid)) {
+ return Status::OK();
}
}
}
if (!has_valid_value) {
+ for (int i = 0; i < block.columns(); ++i) {
+ auto column = block.get_by_position(i).column->assume_mutable();
+ column->pop_back(1);
Review Comment:
If has no valid value in json line and we fill with default value, it's not
reasonableļ¼so we should remove this line in block. I will add some comment there
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]