taepper commented on code in PR #50725:
URL: https://github.com/apache/arrow/pull/50725#discussion_r3684201409


##########
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:
   Yes, they are currently directly in the source file `from_string.cc`, but 
are supposed to be pulled out for reuse in other implementations. I do not know 
whether we have a good file for such json-related helper functions already?



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

Reply via email to