tustvold commented on code in PR #13901:
URL: https://github.com/apache/arrow/pull/13901#discussion_r1053430210
##########
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:
The PR description says
> This extension is backed by utf8()
So I would have naively expected this to be inferred as `arrow::utf8`?
--
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]