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` and `substring` with a hard-coded length.
--
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]