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


##########
cpp/src/parquet/reader_test.cc:
##########
@@ -1230,14 +1223,15 @@ TEST_F(TestJSONWithLocalFile, JSONOutputSortColumns) {
 namespace {
 
 ::arrow::Status CheckJsonValid(std::string_view json_string) {
-  rj::Document json_doc;
-  constexpr auto kParseFlags = rj::kParseFullPrecisionFlag | 
rj::kParseNanAndInfFlag;
-  json_doc.Parse<kParseFlags>(json_string.data(), json_string.length());
-  if (json_doc.HasParseError()) {
-    return ::arrow::Status::Invalid("JSON parse error at offset ",
-                                    json_doc.GetErrorOffset(), ": ",
-                                    
rj::GetParseError_En(json_doc.GetParseError()));
+  simdjson::ondemand::parser parser;
+  simdjson::ondemand::document document;
+
+  auto padded_json = simdjson::padded_string(json_string);
+
+  if (auto error = parser.iterate(padded_json).get(document)) {

Review Comment:
   The `NaN`/`Inf` case is a very unfortunate one. While not being part of the 
official JSON RFC, it will be added to the next simdjson release: 
https://github.com/simdjson/simdjson/pull/2696
   
   I added behavior preserving json parsing to our testing helpers in 
`from_string.cc`:
   
   https://github.com/apache/arrow/pull/50653
   
   Maybe that work-around is also acceptable here?
   



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