flyrain commented on code in PR #4683:
URL: https://github.com/apache/iceberg/pull/4683#discussion_r866189225
##########
api/src/main/java/org/apache/iceberg/Schema.java:
##########
@@ -381,6 +381,22 @@ public String idToAlias(Integer fieldId) {
return null;
}
+ /**
+ * Returns the index of the given field id.
+ *
+ * @param fieldId a column id in this schema
+ * @return the index of the field in the schema, or -1 if one wasn't found
+ */
+ public int idToIndex(Integer fieldId) {
Review Comment:
Thanks for the name suggestion. There are always performance concerns about
non-primitive type. I'm kind of OK with both primitive type and non-primitive
type here. In terms of consistency, these two public methods also return `int`.
I will leave the return type to `int` unless we have a strong reason to use
Integer.
```
public int schemaId()
public int highestFieldId()
```
--
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]