stevenzwu commented on code in PR #13327:
URL: https://github.com/apache/iceberg/pull/13327#discussion_r2180619395


##########
api/src/main/java/org/apache/iceberg/actions/RewriteDataFiles.java:
##########
@@ -199,6 +201,16 @@ default RewriteDataFiles zOrder(String... columns) {
    */
   RewriteDataFiles filter(Expression expression);
 
+  /**
+   * A user-defined predicate for filtering out data files to include in the 
rewrite.
+   *
+   * @param predicate A predicate that returns true to include a file, false 
otherwise
+   * @return this for chaining
+   */
+  default RewriteDataFiles fileFilter(Predicate<DataFile> predicate) {

Review Comment:
   This is a very interesting idea and worth explore.
   
   `ManifestGroup` support two filter expressions
   ```
     ManifestGroup filterData(Expression newDataFilter)
     ManifestGroup filterFiles(Expression newFileFilter) 
   ```
   
   `FindFiles` use the file filter
   ```
       Iterable<DataFile> files =
           FindFiles.in(table)
               .withMetadataMatching(Expressions.startsWith("file_path", 
"/path/to/data-a"))
               .collect();
   ```



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