sl255051 commented on code in PR #10678:
URL: https://github.com/apache/iceberg/pull/10678#discussion_r1707732421
##########
api/src/main/java/org/apache/iceberg/types/TypeUtil.java:
##########
@@ -181,11 +181,34 @@ public static Map<Integer, String> indexQuotedNameById(
return indexer.byId();
}
+ /**
+ * Creates a mapping from lower-case field names to their corresponding
field IDs.
+ *
+ * <p>This method iterates over the fields of the provided struct and maps
each field's name
+ * (converted to lower-case) to its ID. If two fields have the same
lower-case name, an
+ * `IllegalArgumentException` is thrown.
+ *
+ * @param struct the struct type whose fields are to be indexed
+ * @return a map where the keys are lower-case field names and the values
are field IDs
+ * @throws IllegalArgumentException if two fields have the same lower-case
name
Review Comment:
I respectfully disagree that IllegalStateException is more accurate. To me
"state" is preexists a method call. State applies more to an instance method.
In this case this is a static method; there is no class and there is no state.
The argument `struct` is the only input to this method and that `struct` is
invalid for indexing by lower case name.
--
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]