paleolimbot commented on code in PR #45459:
URL: https://github.com/apache/arrow/pull/45459#discussion_r2059539139
##########
cpp/src/parquet/arrow/arrow_schema_test.cc:
##########
@@ -1343,6 +1390,96 @@ TEST_F(TestConvertArrowSchema,
ParquetFlatPrimitivesAsDictionaries) {
ASSERT_NO_FATAL_FAILURE(CheckFlatSchema(parquet_fields));
}
+TEST_F(TestConvertArrowSchema, ParquetGeoArrowCrsLonLat) {
+ // All the Arrow Schemas below should convert to the type defaults for
GEOMETRY
+ // and GEOGRAPHY when GeoArrow extension types are registered and the
appropriate
+ // writer option is set.
+ ::arrow::ExtensionTypeGuard guard(test::geoarrow_wkb());
+
+ std::vector<NodePtr> parquet_fields;
+ parquet_fields.push_back(PrimitiveNode::Make("geometry",
Repetition::OPTIONAL,
+ LogicalType::Geometry(),
+ ParquetType::BYTE_ARRAY));
+ parquet_fields.push_back(PrimitiveNode::Make("geography",
Repetition::OPTIONAL,
+ LogicalType::Geography(),
+ ParquetType::BYTE_ARRAY));
+
+ // There are several ways that longitude/latitude could be specified when
coming from
+ // GeoArrow, which allows null, missing, arbitrary strings (e.g.,
Authority:Code), and
+ // PROJJSON.
+ std::vector<std::string> geoarrow_lonlat = {
+ "null", R"("OGC:CRS84")", R"("EPSG:4326")",
+ // Purely the parts of the PROJJSON that we inspect to check the lon/lat
case
+ R"({"id": {"authority": "OGC", "code": "CRS84"}})",
+ R"({"id": {"authority": "EPSG", "code": 4326}})"};
Review Comment:
I added support for this as well!
--
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]