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


##########
cpp/src/arrow/json/test_common.h:
##########
@@ -258,14 +261,26 @@ inline static Status ParseFromString(ParseOptions 
options, string_view src_str,
 }
 
 static inline std::string PrettyPrint(string_view one_line) {
-  rj::Document document;
+  simdjson::ondemand::parser parser;
 
   // Must pass size to avoid ASAN issues.
-  document.Parse(one_line.data(), one_line.size());
-  rj::StringBuffer sb;
-  rj::PrettyWriter<rj::StringBuffer> writer(sb);
-  document.Accept(writer);
-  return sb.GetString();
+  simdjson::padded_string json(one_line.data(), one_line.size());

Review Comment:
   I moved the regression test to `simdjson_internal_test.cc` and it now tests 
`PrettyPrintJsonValue()` directly.
   
   I also checked the remaining uses of the `PrettyPrint(std::string_view)` 
helper: it is only used by `parser_benchmark.cc`. So if I replace it with 
`fractured_json_string()`, the existing test suite won't exercise that helper 
anymore.
   
   Given that `PrettyPrintJsonValue()` would then have no caller other than its 
own test, do you intend for us to keep `PrettyPrintJsonValue()` as a standalone 
utility, or should `PrettyPrint()` simply use `fractured_json_string()` and we 
remove the custom formatter?



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