dramaticlly commented on code in PR #4629:
URL: https://github.com/apache/iceberg/pull/4629#discussion_r858108695


##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/actions/BaseExpireSnapshotsSparkAction.java:
##########
@@ -243,23 +246,28 @@ private BaseExpireSnapshotsActionResult 
deleteFiles(Iterator<Row> expired) {
           String file = fileInfo.getString(0);
           String type = fileInfo.getString(1);
           deleteFunc.accept(file);
-          switch (type) {
-            case CONTENT_FILE:
-              dataFileCount.incrementAndGet();
-              LOG.trace("Deleted Content File: {}", file);
-              break;
-            case MANIFEST:
-              manifestCount.incrementAndGet();
-              LOG.debug("Deleted Manifest: {}", file);
-              break;
-            case MANIFEST_LIST:
-              manifestListCount.incrementAndGet();
-              LOG.debug("Deleted Manifest List: {}", file);
-              break;
+          if (type.equalsIgnoreCase(FileContent.DATA.name())) {

Review Comment:
   nit: would it be better to switch the position such as 
   `FileContent.DATA.name().equalsIgnoreCase(type)`
   
   to provide better guarantee if type is null?



##########
core/src/main/java/org/apache/iceberg/actions/BaseExpireSnapshotsActionResult.java:
##########
@@ -22,13 +22,19 @@
 public class BaseExpireSnapshotsActionResult implements ExpireSnapshots.Result 
{
 
   private final long deletedDataFilesCount;
+  private final long deletedPosDeleteFilesCount;
+  private final long deletedEqDeleteFilesCount;
   private final long deletedManifestsCount;
   private final long deletedManifestListsCount;
 
   public BaseExpireSnapshotsActionResult(long deletedDataFilesCount,
+                                         long deletedPosDeleteFilesCount,

Review Comment:
   It's also used in Spark 2.4 code 
https://github.com/apache/iceberg/blob/master/spark/v2.4/spark/src/main/java/org/apache/iceberg/spark/actions/BaseExpireSnapshotsSparkAction.java#L274



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