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