pradeepg26 commented on code in PR #13901:
URL: https://github.com/apache/arrow/pull/13901#discussion_r1053638685
##########
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:
I think that should be fine. The behavior should be implementation
dependent. So, if the Rust implementation reads the Parquet JSON type as `utf8`
it should continue to do that.
I'm not currently planning on touching the Rust implementation. If and when
it is updated to support this extension, I would expect the current behavior to
be preserved if the user requests the extension to be disabled.
--
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]