liurenjie1024 commented on code in PR #1578:
URL: https://github.com/apache/iceberg-rust/pull/1578#discussion_r2256636451


##########
crates/iceberg/src/delete_vector.rs:
##########
@@ -43,6 +43,18 @@ impl DeleteVector {
         self.inner.insert(pos)
     }
 
+    /// Mark the given [`positions`] as deleted, and return the number of 
elements appended to the set.
+    ///
+    /// Precondition: The values of the iterator must be ordered and strictly 
greater than the greatest value in the set.
+    /// If a value in the iterator doesn’t satisfy this requirement, it is not 
added and the append operation is stopped.
+    #[allow(dead_code)]
+    pub fn insert_positions(&mut self, positions: &[u64]) -> u64 {

Review Comment:
   Also please add some tests for the case where there are intersections.



##########
crates/iceberg/src/delete_vector.rs:
##########
@@ -43,6 +43,18 @@ impl DeleteVector {
         self.inner.insert(pos)
     }
 
+    /// Mark the given [`positions`] as deleted, and return the number of 
elements appended to the set.
+    ///
+    /// Precondition: The values of the iterator must be ordered and strictly 
greater than the greatest value in the set.
+    /// If a value in the iterator doesn’t satisfy this requirement, it is not 
added and the append operation is stopped.
+    #[allow(dead_code)]
+    pub fn insert_positions(&mut self, positions: &[u64]) -> u64 {

Review Comment:
   There are some misunderstading here. What I mean is:
   1. If the inner `append` fail, we should also return this error.
   2. If we succeeded, we should return the actual number inserted, rather the 
len of `positions`. The difference is, if the `inner` already contains some 
value in `positions`, the returned length should substract the common part.
   
   Please add detailed doc for the behavior.



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