szehon-ho commented on code in PR #16765:
URL: https://github.com/apache/iceberg/pull/16765#discussion_r3484341702


##########
api/src/main/java/org/apache/iceberg/types/Types.java:
##########
@@ -584,21 +585,30 @@ public static GeometryType of(String crs) {
     private final String crs;
 
     private GeometryType() {
-      crs = null;
+      this(null);
     }
 
     private GeometryType(String crs) {
       Preconditions.checkArgument(crs == null || !crs.isEmpty(), "Invalid CRS: 
(empty string)");
-      this.crs = DEFAULT_CRS.equalsIgnoreCase(crs) ? null : crs;
+      // an omitted CRS canonicalizes to the default; a provided value is kept 
as-is (case
+      // preserved)
+      this.crs = crs == null ? DEFAULT_CRS : crs;
     }
 
     @Override
     public TypeID typeId() {
       return TypeID.GEOMETRY;
     }
 
+    /**
+     * Returns this type's CRS, preserving the casing it was created with.
+     *
+     * <p>CRS values are compared case-insensitively, so two {@code geometry} 
types whose CRS differ

Review Comment:
   nit: can we put this on equals(), and the class?
   
   Seems its a better fit than here



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