github-actions[bot] commented on code in PR #63309:
URL: https://github.com/apache/doris/pull/63309#discussion_r3254107384
##########
be/src/util/jsonb_parser_simd.h:
##########
@@ -118,15 +105,7 @@ struct JsonbParser {
break;
}
case simdjson::ondemand::json_type::number: {
- simdjson::ondemand::number num;
- simdjson::error_code res = doc.get_number().get(num);
- if (!parse_number_success(res)) {
- return Status::InvalidArgument(fmt::format("simdjson
get_number failed: {}",
-
simdjson::error_message(res)));
- }
- // simdjson get_number() returns a number object, which can be
- RETURN_IF_ERROR(
- write_number(num, doc.get_number_type(),
doc.raw_json_token(), writer));
+ RETURN_IF_ERROR(write_number_value(doc, writer));
break;
Review Comment:
This parse path still returns `OK` without verifying that the root value
consumed the whole input. The new scalar checks cover cases like
`nullx`/`100x`, but for object and array roots `parse(doc.get_value(), writer)`
only consumes that value; without a final `doc.at_end()` (or equivalent) check,
inputs such as `{}x` or `[]x` can be serialized as valid JSONB and
`json_valid`/casts/ingestion will accept only the prefix. Please add a
single-pass end-of-document validation after the switch and add tests for
top-level object/array values followed by trailing garbage.
--
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]