tustvold commented on code in PR #13901:
URL: https://github.com/apache/arrow/pull/13901#discussion_r1053633363


##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -1410,6 +1417,43 @@ TEST_F(TestLargeStringParquetIO, Basics) {
   this->RoundTripSingleColumn(large_array, large_array, arrow_properties);
 }
 
+using TestJsonParquetIO = TestParquetIO<::arrow::extension::JsonExtensionType>;
+
+TEST_F(TestJsonParquetIO, JsonExtension) {
+  const char* json = R"([
+    "null",
+    "1234",
+    "3.14159",
+    "true",
+    "false",
+    "\"a json string\"",
+    "[\"a\", \"json\", \"array\"]",
+    "{\"obj\": \"a simple json object\"}"
+  ])";
+
+  const auto json_type = ::arrow::extension::json();
+  const auto json_string_array = ::arrow::ArrayFromJSON(::arrow::utf8(), json);
+  const auto json_array = ::arrow::ExtensionType::WrapArray(json_type, 
json_string_array);
+
+  // When the original Arrow schema isn't stored and Arrow extensions are 
disabled,
+  // LogicalType::JSON is read as Binary.
+  const auto binary_array = ::arrow::ArrayFromJSON(::arrow::binary(), json);

Review Comment:
   Do you foresee an issue with my changing the Rust parquet reader to infer as 
UTF-8 in https://github.com/apache/arrow-rs/pull/3376, at least until such a 
time as this extension type is stabilised?



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