taepper commented on code in PR #50725:
URL: https://github.com/apache/arrow/pull/50725#discussion_r3684359248
##########
cpp/src/arrow/json/json_writer_internal.cc:
##########
@@ -96,6 +98,117 @@ void JsonWriter::Double(double value) {
needs_comma_ = true;
}
+Status JsonWriter::WriteValue(sj::value value) {
+ sj::json_type type;
+ if (auto error = value.type().get(type); error != simdjson::SUCCESS) {
+ return Status::Invalid(simdjson::error_message(error));
+ }
+
+ switch (type) {
Review Comment:
(An interesting note: also for the `sj::object` and `sj::array` cases the
`.get` calls will succeed and no full object/array validation will be done, it
just checks the first character to be an `{` or `[`. Parsing will continue
lazily):
https://github.com/simdjson/simdjson/blob/93fce66af808ad49cac2c9682295f5a2a1f78575/doc/basics.md?plain=1#L500
--
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]