You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/02/25 22:10:39 UTC

[GitHub] [iceberg] RussellSpitzer commented on pull request #2273: Core: Add predicate to rewrite action

RussellSpitzer commented on pull request #2273:
URL: https://github.com/apache/iceberg/pull/2273#issuecomment-786261493


   I believe so, for a preview i'm thinking that we should make rewrite/optimize an action which takes a variable "CompactionStrategy" class that has a form like
   ```java
     /**
      * Removes all file references which this plan will not rewrite.
      * @param dataFiles iterator of live datafiles in a given partition
      * @return iterator containing only files to be rewritten
      */
     Iterator<DataFile> filesToCompact(Iterator<DataFile> dataFiles);
   
     /**
      * Groups files into lists which will be processed in a single executable
      * unit. Each group will end up being committed as an independent set of
      * changes.
      * @param dataFiles iterator of files to be rewritten
      * @return iterator of sets of files to be processed together
      */
     Iterator<List<DataFile>> groupsFilesPerJob(Iterator<DataFile> dataFiles);
   
     /**
      * Method which will actually rewrite and commit changes to a group of files
      * based on the particular CompactionStrategy's algorithm
      * @param filesToRewrite a group of files to be rewritten together
      * @return a list of newly committed files
      */
     List<DataFile> rewriteFiles(List<DataFile> filesToRewrite);
   }
   ```
   
   Although I think we may need to have the methods use FileScanTask since we are going to need access to DeleteFiles and Data files to properly run the "rewrite" action ... I hope to get this up soon, I just have been wavering on that issue since it is no longer trivial to take a set of DataFiles and generate tasks to read them.


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org