aokolnychyi commented on code in PR #11463:
URL: https://github.com/apache/iceberg/pull/11463#discussion_r1828223745


##########
core/src/main/java/org/apache/iceberg/deletes/BitmapPositionDeleteIndex.java:
##########
@@ -92,4 +107,113 @@ public Collection<DeleteFile> deleteFiles() {
   public long cardinality() {
     return bitmap.cardinality();
   }
+
+  /**
+   * Serializes the index using the following format:
+   *
+   * <ul>
+   *   <li>The length of the magic bytes and bitmap stored as 4 bytes 
(big-endian).
+   *   <li>A 4-byte {@link #MAGIC_NUMBER} (little-endian).
+   *   <li>The bitmap serialized using the portable Roaring spec 
(little-endian).
+   *   <li>A CRC-32 checksum of the magic bytes and bitmap as 4-bytes 
(big-endian).
+   * </ul>
+   *
+   * Note that the length and the checksum are computed for the bitmap data, 
which includes the
+   * magic bytes and bitmap for compatibility with Delta.
+   */
+  @Override
+  public ByteBuffer serialize() {

Review Comment:
   Puffin writers currently assume we will create and pass `ByteBuffer`. We 
also compute a checksum on serialized magic bytes and bitmap, so I am 
allocating a byte array upfront.



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