You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "ajantha-bhat (via GitHub)" <gi...@apache.org> on 2023/03/01 07:23:12 UTC

[GitHub] [iceberg] ajantha-bhat commented on a diff in pull request #6091: Spark-3.3: Handle statistics file clean up from expireSnapshots action/procedure

ajantha-bhat commented on code in PR #6091:
URL: https://github.com/apache/iceberg/pull/6091#discussion_r1121261550


##########
core/src/main/java/org/apache/iceberg/ReachableFileUtil.java:
##########
@@ -137,11 +139,21 @@ public static List<String> manifestListLocations(Table table, Set<Long> snapshot
    * @return the location of statistics files
    */
   public static List<String> statisticsFilesLocations(Table table) {
-    List<String> statisticsFilesLocations = Lists.newArrayList();
-    for (StatisticsFile statisticsFile : table.statisticsFiles()) {
-      statisticsFilesLocations.add(statisticsFile.path());
-    }
+    return statisticsFilesLocations(table, statisticsFile -> true);
+  }
 
-    return statisticsFilesLocations;
+  /**
+   * Returns locations of statistics files for a table matching the given predicate .
+   *
+   * @param table table for which statistics files needs to be listed
+   * @param statisticsFilePredicate predicate for filtering the statistics files
+   * @return the location of statistics files
+   */
+  public static List<String> statisticsFilesLocations(
+      Table table, Predicate<StatisticsFile> statisticsFilePredicate) {

Review Comment:
   ok. Done



-- 
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-unsubscribe@iceberg.apache.org

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