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


##########
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:
   This is to preserve the existing behavior.
   
   We currently read `LogicalType::JSON` as `arrow::binary`. So, if there is no 
schema information and the extensions are disabled, then we use the current 
behavior.



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