paleolimbot commented on code in PR #55599:
URL: https://github.com/apache/arrow/pull/55599#discussion_r4608029952


##########
cpp/src/parquet/geospatial/util_json_internal_test.cc:
##########
@@ -30,6 +31,124 @@
 
 namespace parquet {
 
+struct LogicalTypeToGeoArrowCase {
+  std::shared_ptr<const LogicalType> logical_type;
+  std::string expected_metadata;
+};
+
+class LogicalTypeToGeoArrowTest
+    : public ::testing::TestWithParam<LogicalTypeToGeoArrowCase> {};
+
+TEST_P(LogicalTypeToGeoArrowTest, ConvertsMetadata) {
+  ::arrow::ExtensionTypeGuard guard(test::geoarrow_wkb());
+  const auto& test_case = GetParam();
+  ARROW_SCOPED_TRACE("logical type = ", test_case.logical_type->ToString());
+
+  ASSERT_OK_AND_ASSIGN(
+      auto type,
+      GeoArrowTypeFromLogicalType(*test_case.logical_type, nullptr, 
::arrow::binary()));
+  auto extension = std::dynamic_pointer_cast<::arrow::ExtensionType>(type);
+  ASSERT_NE(extension, nullptr);
+  ASSERT_OK_AND_ASSIGN(auto actual,
+                       ::arrow::internal::MinifyJson(extension->Serialize()));
+  EXPECT_EQ(actual, test_case.expected_metadata);
+}
+
+INSTANTIATE_TEST_SUITE_P(
+    GeoArrowConversion, LogicalTypeToGeoArrowTest,
+    ::testing::Values(

Review Comment:
   I added a few!



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