deniskuzZ commented on code in PR #5328:
URL: https://github.com/apache/hive/pull/5328#discussion_r1700014840


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergTableUtil.java:
##########
@@ -393,28 +393,47 @@ public static PartitionData toPartitionData(StructLike 
sourceKey, Types.StructTy
     return data;
   }
 
-  public static List<DataFile> getDataFiles(Table table, int specId,
-      String partitionPath) {
+  /**
+   * Returns list of data files filtered by specId and partitionPath as 
following:
+   *  1. If matchBySpecId is true, then filters files by specId == file's 
specId, else by specId != file's specId
+   *  2. If partitionPath is not null, then also filters files where 
partitionPath == file's partition path
+   * @param table the iceberg table
+   * @param specId partition spec id
+   * @param partitionPath partition path
+   * @param matchBySpecId If true, searches for files matching the specId, 
else searches for ones that don't match
+   */
+  public static List<DataFile> getDataFiles(Table table, int specId, String 
partitionPath, boolean matchBySpecId) {

Review Comment:
   wouldn't it be better to pass a filter
   ````
   public static List<DataFile> getDataFiles(Table table, Predicate<Object> 
matchBySpecId, ..) {
   ...
   matchBySpecId.test(file.specId())
   }
   ````
   getDataFiles(table, Predicate.isEqual(specId))
   getDataFiles(table, Predicate.isEqual(specid).negate())



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to