deniskuzZ commented on code in PR #12629: URL: https://github.com/apache/iceberg/pull/12629#discussion_r2014289247
########## data/src/main/java/org/apache/iceberg/data/PartitionStatsHandler.java: ########## @@ -135,20 +147,110 @@ public static PartitionStatisticsFile computeAndWriteStatsFile(Table table) thro */ public static PartitionStatisticsFile computeAndWriteStatsFile(Table table, long snapshotId) throws IOException { + return incrementalComputeAndWrite(table, snapshotId, true /* recompute */); + } + + /** + * Incrementally computes the stats after the snapshot that has partition stats file till the + * given snapshot and writes the combined result into a {@link PartitionStatisticsFile} after + * merging the stats. + * + * @param table The {@link Table} for which the partition statistics is computed. + * @param snapshotId snapshot for which partition statistics are computed. + * @return {@link PartitionStatisticsFile} for the given snapshot, or null if no statistics are + * present. + */ + public static PartitionStatisticsFile computeAndWriteStatsFileIncremental( + Table table, long snapshotId) throws IOException { + return incrementalComputeAndWrite(table, snapshotId, false /* recompute */); + } + + private static PartitionStatisticsFile incrementalComputeAndWrite( Review Comment: not sure if we should keep 'incremental' in the method name since it might not be incremental -- 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