sl255051 commented on code in PR #10678:
URL: https://github.com/apache/iceberg/pull/10678#discussion_r1702994679


##########
api/src/main/java/org/apache/iceberg/types/TypeUtil.java:
##########
@@ -182,11 +181,10 @@ public static Map<Integer, String> indexQuotedNameById(
   }
 
   public static Map<String, Integer> indexByLowerCaseName(Types.StructType 
struct) {
-    Map<String, Integer> indexByLowerCaseName = Maps.newHashMap();
+    ImmutableMap.Builder<String, Integer> builder = ImmutableMap.builder();
     indexByName(struct)
-        .forEach(
-            (name, integer) -> 
indexByLowerCaseName.put(name.toLowerCase(Locale.ROOT), integer));
-    return indexByLowerCaseName;
+        .forEach((name, integer) -> builder.put(name.toLowerCase(Locale.ROOT), 
integer));
+    return builder.buildOrThrow();

Review Comment:
   I have manually tested this change and the result is below
   ```
   java.lang.IllegalArgumentException: Unable to build field name to id mapping 
because two fields have the same lower case name: order_date and ORDER_DATE
   ```



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