szehon-ho commented on code in PR #6661:
URL: https://github.com/apache/iceberg/pull/6661#discussion_r1184409917


##########
core/src/main/java/org/apache/iceberg/PartitionsTable.java:
##########
@@ -229,18 +281,41 @@ static class Partition {
     private int specId;
     private long dataRecordCount;
     private int dataFileCount;
+    private long posDeleteRecordCount;
+    private int posDeleteFileCount;
+    private long eqDeleteRecordCount;
+    private int eqDeleteFileCount;
 
     Partition(StructLike key) {
       this.key = key;
       this.specId = 0;
       this.dataRecordCount = 0;
       this.dataFileCount = 0;
+      this.posDeleteRecordCount = 0;
+      this.posDeleteFileCount = 0;
+      this.eqDeleteRecordCount = 0;
+      this.eqDeleteFileCount = 0;
     }
 
-    void update(DataFile file) {
-      this.dataRecordCount += file.recordCount();
-      this.dataFileCount += 1;
-      this.specId = file.specId();
+    void update(ContentFile<?> file) {
+      switch (file.content()) {
+        case DATA:
+          this.dataRecordCount += file.recordCount();
+          this.dataFileCount += 1;
+          this.specId = file.specId();
+          break;
+        case POSITION_DELETES:
+          this.posDeleteRecordCount = file.recordCount();
+          this.posDeleteFileCount += 1;
+          break;

Review Comment:
   How about specId here and below?



##########
spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/source/TestIcebergSourceTablesBase.java:
##########
@@ -1382,6 +1404,76 @@ public void testPartitionsTable() {
       TestHelpers.assertEqualsSafe(
           partitionsTable.schema().asStruct(), expected.get(i), actual.get(i));
     }
+
+    testDeleteStats(tableIdentifier, table, partitionsTable, builder, 
partitionBuilder, expected);

Review Comment:
   Could we make this test independently?  As the existing test is already 
quite long, and it's doing more table modifications inside the new method.



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

Reply via email to