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


##########
api/src/main/java/org/apache/iceberg/types/Types.java:
##########
@@ -70,6 +75,20 @@ public static Type fromTypeName(String typeString) {
       return TYPES.get(lowerTypeString);
     }
 
+    if (lowerTypeString.startsWith("geometry")) {

Review Comment:
   So we consider CRS to be case sensitive?
   
   The capture group of a case insensitive regular expression returns the 
matched characters without modification. So if CRS is case sensitive, you can 
still use a regular expression, like this:
   
   ```java
       Pattern pattern = Pattern.compile("geometry\\(([^)]*)\\)", 
Pattern.CASE_INSENSITIVE);
   ```
   
   This test will pass:
   ```java
       Matcher m = pattern.matcher("GEOMETRY(aBc)");
       assertThat(m.matches()).isTrue();
       assertThat(m.group(1)).isEqualTo("aBc");
   ```
   
   I'd prefer using a case insensitive pattern on `typeString` like this, 
rather than `startsWith`.



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