paleolimbot commented on code in PR #45459: URL: https://github.com/apache/arrow/pull/45459#discussion_r2017866390
########## cpp/src/parquet/types.cc: ########## @@ -1619,6 +1658,209 @@ class LogicalType::Impl::Float16 final : public LogicalType::Impl::Incompatible, GENERATE_MAKE(Float16) +namespace { +void WriteCrsKeyAndValue(const std::string& crs, std::ostream& json) { + // There is no restriction on the crs value here, and it may contain quotes + // or backslashes that would result in invalid JSON if unescaped. + json << R"(, "crs": ")"; + for (char c : crs) { + switch (c) { + case '"': + json << R"(\")"; + break; + case '\\': + json << R"(\\)"; + break; + default: Review Comment: My solution here is a little clunky...there may be a better way! -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org