steveloughran commented on code in PR #17112:
URL: https://github.com/apache/iceberg/pull/17112#discussion_r3528319279


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveSchemaUtil.java:
##########
@@ -212,6 +213,44 @@ public void testVariantTypeConvertToHiveSchema() {
     assertThat(hiveSchema).containsExactly(new FieldSchema("variant_field", 
"unknown", null));
   }
 
+  @Test
+  public void testGeometryTypeConvertToHiveSchema() {
+    Schema schema = new Schema(optional(0, "geometry_field", 
Types.GeometryType.crs84()));
+    List<FieldSchema> hiveSchema = HiveSchemaUtil.convert(schema);
+    assertThat(hiveSchema).containsExactly(new FieldSchema("geometry_field", 
"binary", null));

Review Comment:
   add a `.describedAs("hive schema %s", schema)` before the 
`.containsExactly()` for even better assertion details.



##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveSchemaUtil.java:
##########
@@ -166,6 +166,8 @@ private static String convertToTypeString(Type type) {
         return "timestamp";
       case FIXED:
       case BINARY:
+      case GEOMETRY:

Review Comment:
   as noted by the automated review, consider moving this switch statement to 
the java17 
   `case key -> value` style. The codebase moved to it entirely last month, 
then moved back to ease cherrypicking; if you look at the file history you can 
find the diff so see what to bring over, *just for this switch*



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to