aokolnychyi commented on code in PR #6371:
URL: https://github.com/apache/iceberg/pull/6371#discussion_r1053557589


##########
api/src/main/java/org/apache/iceberg/types/Types.java:
##########
@@ -554,6 +554,10 @@ public List<NestedField> fields() {
       return lazyFieldList();
     }
 
+    public boolean containsField(int id) {

Review Comment:
   I am using it in `SparkPartitioningAwareScan`.
   
   ```
   if (groupingKeyType().containsField(fieldId) && 
!seenFieldIds.contains(fieldId)) {
     groupingKeyFields.add(field);
   }
   ```
   
   I could use `groupingKeyType().field(fieldId) != null` but that seems harder 
to read. Especially, if the condition has multiple branches.
   



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