singhpk234 commented on code in PR #12270:
URL: https://github.com/apache/iceberg/pull/12270#discussion_r1956530298


##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RemoveDanglingDeletesSparkAction.java:
##########
@@ -156,7 +162,12 @@ private List<DeleteFile> findDanglingDeletes() {
             .or(
                 col("data_file.content")
                     .equalTo("2")
-                    
.and(col("sequence_number").$less$eq(col("min_data_sequence_number"))));
+                    
.and(col("sequence_number").$less$eq(col("min_data_sequence_number"))))
+            // dvs pointing to non-existing data files
+            .or(
+                col("data_file.file_format")
+                    .equalTo(FileFormat.PUFFIN.name())

Review Comment:
   file-paths with s3://bucket/<file-name>.parquet and 
s3a://bucket/<file-name>.parquet would be still the same file, it would nice if 
we can handle these scenario as well like we do in orphan file clean up 
   https://github.com/apache/iceberg/issues/4346#issuecomment-1076850852



##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RemoveDanglingDeletesSparkAction.java:
##########
@@ -124,10 +125,15 @@ private List<DeleteFile> findDanglingDeletes() {
             .selectExpr(
                 "data_file.partition as partition",
                 "data_file.spec_id as spec_id",
-                "sequence_number")
-            .groupBy("partition", "spec_id")
+                "sequence_number",
+                "data_file.file_path as file_path")
+            .groupBy("partition", "spec_id", "file_path")
             .agg(min("sequence_number"))
-            .toDF("grouped_partition", "grouped_spec_id", 
"min_data_sequence_number");
+            .toDF(
+                "grouped_partition",
+                "grouped_spec_id",
+                "data_file_path",
+                "min_data_sequence_number");

Review Comment:
   [doubt] can you please elaborate on this ? wouldn't we still need <partition 
/ spec_id> min_data_sequence ? 



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