NathanChung4 commented on code in PR #50877:
URL: https://github.com/apache/arrow/pull/50877#discussion_r3789817377


##########
cpp/src/parquet/types.cc:
##########
@@ -1171,10 +1174,16 @@ std::string LogicalType::Impl::Decimal::ToString() 
const {
 }
 
 std::string LogicalType::Impl::Decimal::ToJSON() const {
-  std::stringstream json;
-  json << R"({"Type": "Decimal", "precision": )" << precision_ << R"(, 
"scale": )"
-       << scale_ << "}";
-  return json.str();
+  ::arrow::json::JsonWriter writer;
+  writer.StartObject();
+  writer.StringField("Type", "Decimal");
+  writer.Key("precision");
+  writer.Int(precision_);
+  writer.Key("scale");

Review Comment:
   Hey Reranko05, thank you for the suggestion and I totally agree with you. I 
have committed the proposed change, please let me know if you want to change 
anything or anything



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