You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "xanderbailey (via GitHub)" <gi...@apache.org> on 2026/09/01 13:41:20 UTC

Re: [PR] perf(deletes): Implement filtering position delete files by file path [iceberg-rust]

xanderbailey commented on code in PR #2936:
URL: https://github.com/apache/iceberg-rust/pull/2936#discussion_r3904692393


##########
crates/iceberg/src/delete_file_index.rs:
##########
@@ -113,25 +115,74 @@ impl DeleteFileIndex {
     }
 }
 
+/// The single data file a position delete file applies to, `None` if it is not tied
+/// to a single data file.
+fn position_delete_target(data_file: &DataFile) -> Option<String> {
+    // data files is named directly
+    if let Some(path) = data_file.referenced_data_file() {
+        return Some(path);
+    }
+
+    // lower and upper bound of reserved field are equal, so all rows
+    // have the same value
+    let lower = data_file
+        .lower_bounds()
+        .get(&RESERVED_FIELD_ID_DELETE_FILE_PATH)?;
+    let upper = data_file
+        .upper_bounds()
+        .get(&RESERVED_FIELD_ID_DELETE_FILE_PATH)?;
+    if lower != upper {
+        return None;
+    }
+
+    match lower.literal() {
+        PrimitiveLiteral::String(path) => Some(path.clone()),
+        _ => None,
+    }
+}
+
+/// Whether a position delete file's sequence number lets it apply to a data file whose
+/// own sequence number is `data_file_seq_num`.
+fn position_delete_applies(delete_seq_num: Option<i64>, data_file_seq_num: Option<i64>) -> bool {

Review Comment:
   Had a poke around today and came up with https://github.com/apache/iceberg-rust/pull/3132 as a potential improvement here.



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