rdblue commented on code in PR #12346:
URL: https://github.com/apache/iceberg/pull/12346#discussion_r2008309673


##########
api/src/main/java/org/apache/iceberg/types/Types.java:
##########
@@ -70,6 +77,21 @@ public static Type fromTypeName(String typeString) {
       return TYPES.get(lowerTypeString);
     }
 
+    Matcher geometry = GEOMETRY_PARAMETERS.matcher(typeString);
+    if (geometry.matches()) {
+      String crs = geometry.group(1);
+      return GeometryType.of(crs != null ? crs.trim() : null);
+    }
+
+    Matcher geography = GEOGRAPHY_PARAMETERS.matcher(typeString);
+    if (geography.matches()) {
+      String crs = geography.group(1);
+      String algorithmName = geography.group(2);
+      EdgeAlgorithm algorithm =
+          algorithmName == null ? null : 
EdgeAlgorithm.fromName(algorithmName.trim());
+      return GeographyType.of(crs != null ? crs.trim() : null, algorithm);

Review Comment:
   Are calls to `trim` needed?



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to