pitrou commented on code in PR #50725:
URL: https://github.com/apache/arrow/pull/50725#discussion_r3684179464
##########
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) {
+ case sj::json_type::object: {
+ StartObject();
+
+ sj::object object;
+ if (auto error = value.get_object().get(object); error !=
simdjson::SUCCESS) {
+ return Status::Invalid(simdjson::error_message(error));
+ }
Review Comment:
Can we factor this pattern out in dedicated helpers? I think @taepper
already did something like that.
--
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]