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


##########
cpp/src/parquet/geospatial/util_json_internal.cc:
##########
@@ -125,18 +178,18 @@ ::arrow::Result<std::string> MakeGeoArrowCrsMetadata(
 }
 
 std::string EscapeCrsAsJsonIfRequired(std::string_view crs) {
-  namespace rj = ::arrow::rapidjson;
-  rj::Document document;
-  if (document.Parse(crs.data(), crs.length()).HasParseError()) {
-    rj::StringBuffer buffer;
-    rj::Writer<rj::StringBuffer> writer(buffer);
-    rj::Value v;
-    v.SetString(crs.data(), static_cast<int32_t>(crs.size()));
-    v.Accept(writer);
-    return std::string(buffer.GetString());
-  } else {
-    return std::string(crs);
+  simdjson::ondemand::parser parser;
+  simdjson::padded_string json(crs);
+
+  if (parser.iterate(json).error() != simdjson::SUCCESS) {
+    ::arrow::json::JsonWriter writer;
+    writer.String(crs);
+
+    auto escaped = writer.GetString().ValueUnsafe();

Review Comment:
   Addressed.



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