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


##########
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:
   That makes sense. Let's first extract these helpers into a shared utility. 
Once that refactoring is merged, I will update this PR to use them. Will pause 
this PR until then.



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