You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "luoyuxia (via GitHub)" <gi...@apache.org> on 2026/03/06 03:08:54 UTC

[PR] feat: introduce basic deletion vector support [paimon-rust]

luoyuxia opened a new pull request, #110:
URL: https://github.com/apache/paimon-rust/pull/110

   <!--
   Thank you very much for contributing to Paimon Rust - we are happy that you want to help us improve it. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [GitHub issue](https://github.com/apache/paimon-rust/issues). Exceptions are made for typos in documentation or comments, which need no issue.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
   
     - Make sure that the change passes the automated tests, i.e., `cargo test` passes.
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
   
   **(The sections below can be removed for hotfixes or typos)**
   -->
   
   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   Linked issue: close #109 
   
   <!-- What is the purpose of the change -->
   
   ### Brief change log
   
   <!-- Please describe the changes made in this pull request and explain how they address the issue -->
   
   ### Tests
   
   <!-- List unit tests or integration cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature or require documentation updates -->
   


-- 
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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: introduce basic deletion vector support [paimon-rust]

Posted by "XiaoHongbo-Hope (via GitHub)" <gi...@apache.org>.
XiaoHongbo-Hope commented on code in PR #110:
URL: https://github.com/apache/paimon-rust/pull/110#discussion_r2901311770


##########
crates/paimon/src/deletion_vector/core.rs:
##########
@@ -0,0 +1,185 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+#![allow(dead_code)]
+
+use roaring::RoaringBitmap;
+use std::sync::Arc;
+
+/// DeletionVector represents a set of row positions that have been deleted.
+/// Uses RoaringBitmap for efficient storage, similar to Java's BitmapDeletionVector.
+///
+/// Impl Reference: <https://github.com/apache/paimon/blob/release-1.3/paimon-core/src/main/java/org/apache/paimon/deletionvectors/BitmapDeletionVector.java>
+#[derive(Debug, Clone)]
+pub struct DeletionVector {
+    /// RoaringBitmap storing deleted row positions (0-indexed)
+    /// Using u32 as RoaringBitmap32 in Java supports up to 2^31-1 rows
+    bitmap: Arc<RoaringBitmap>,
+}
+
+/// Magic number for BitmapDeletionVector serialization format
+/// Same as Java: 1581511376
+const MAGIC_NUMBER: u32 = 1581511376;
+const MAGIC_NUMBER_SIZE_BYTES: usize = 4;
+
+impl DeletionVector {
+    /// Create a new empty DeletionVector
+    pub fn empty() -> Self {
+        Self {
+            bitmap: Arc::new(RoaringBitmap::new()),
+        }
+    }
+
+    /// Create a new DeletionVector from a RoaringBitmap
+    pub fn from_bitmap(bitmap: RoaringBitmap) -> Self {
+        Self {
+            bitmap: Arc::new(bitmap),
+        }
+    }
+
+    /// Check if a row at the given position is deleted
+    pub fn is_deleted(&self, row_position: u64) -> bool {
+        // RoaringBitmap32 in Java supports up to 2^31-1, so we check u32 range
+        if row_position > u32::MAX as u64 {
+            return false;

Review Comment:
   paimon java throw exception 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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: introduce basic deletion vector support [paimon-rust]

Posted by "luoyuxia (via GitHub)" <gi...@apache.org>.
luoyuxia commented on PR #110:
URL: https://github.com/apache/paimon-rust/pull/110#issuecomment-4018363849

   @XiaoHongbo-Hope Thanks for reviewing. Comments has been addressed.


-- 
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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: introduce basic deletion vector support [paimon-rust]

Posted by "XiaoHongbo-Hope (via GitHub)" <gi...@apache.org>.
XiaoHongbo-Hope commented on code in PR #110:
URL: https://github.com/apache/paimon-rust/pull/110#discussion_r2901305224


##########
crates/paimon/Cargo.toml:
##########
@@ -51,6 +51,8 @@ opendal = { version = "0.49", features = ["services-fs"] }
 pretty_assertions = "1"
 apache-avro = { version = "0.17", features = ["snappy"] }
 indexmap = "2.5.0"
+roaring = "0.10"
+crc32fast = "1.4"

Review Comment:
   seems no usage in current diff.



-- 
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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: introduce basic deletion vector support [paimon-rust]

Posted by "XiaoHongbo-Hope (via GitHub)" <gi...@apache.org>.
XiaoHongbo-Hope commented on code in PR #110:
URL: https://github.com/apache/paimon-rust/pull/110#discussion_r2901305224


##########
crates/paimon/Cargo.toml:
##########
@@ -51,6 +51,8 @@ opendal = { version = "0.49", features = ["services-fs"] }
 pretty_assertions = "1"
 apache-avro = { version = "0.17", features = ["snappy"] }
 indexmap = "2.5.0"
+roaring = "0.10"
+crc32fast = "1.4"

Review Comment:
   seems no usage until now.



-- 
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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: introduce basic deletion vector support [paimon-rust]

Posted by "luoyuxia (via GitHub)" <gi...@apache.org>.
luoyuxia closed pull request #110: feat: introduce basic deletion vector support
URL: https://github.com/apache/paimon-rust/pull/110


-- 
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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: introduce basic deletion vector support [paimon-rust]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on PR #110:
URL: https://github.com/apache/paimon-rust/pull/110#issuecomment-4020975175

   +1


-- 
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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: introduce basic deletion vector support [paimon-rust]

Posted by "XiaoHongbo-Hope (via GitHub)" <gi...@apache.org>.
XiaoHongbo-Hope commented on code in PR #110:
URL: https://github.com/apache/paimon-rust/pull/110#discussion_r2901305224


##########
crates/paimon/Cargo.toml:
##########
@@ -51,6 +51,8 @@ opendal = { version = "0.49", features = ["services-fs"] }
 pretty_assertions = "1"
 apache-avro = { version = "0.17", features = ["snappy"] }
 indexmap = "2.5.0"
+roaring = "0.10"
+crc32fast = "1.4"

Review Comment:
   no usage 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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: introduce basic deletion vector support [paimon-rust]

Posted by "XiaoHongbo-Hope (via GitHub)" <gi...@apache.org>.
XiaoHongbo-Hope commented on PR #110:
URL: https://github.com/apache/paimon-rust/pull/110#issuecomment-4018427952

   +1
   
   


-- 
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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat: introduce basic deletion vector support [paimon-rust]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #110:
URL: https://github.com/apache/paimon-rust/pull/110


-- 
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@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org