Repository navigation
Conversation
Add MutableMumblingBitmap, the write side of the Mumbling bitmap format used by v4 manifest deletion vectors. Like Java's MutableBitmap, it sets positions, merges existing bitmaps, and serializes to the same bytes as the Java writer. EncodePforBytes() encodes the descriptor array the way the Java encoder does. Test: - New tests in mumbling_bitmap_test.cc cover round trips through MumblingBitmapView, byte-for-byte equality with the Java-generated fixtures, merging, and invalid positions. - New microbenchmarks: BM_PforEncode, BM_Set and BM_Serialize.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1194. Part of #1107.
Adds the write side of the Mumbling bitmap format (a draft spec, apache/iceberg#16518) for v4 manifest deletion vectors (
manifest_info.dv,tracking.deleted_positionsandtracking.replaced_positions). It sits next to the reader from #1126 inutil/mumbling_bitmap_internal.h.MutableMumblingBitmapmatches Java'sMutableBitmap(apache/iceberg#18138):Set(pos)adds a position and reports whether it was new.Merge(view)adds every position of an existing bitmap.Serialize()writes format version 1.As in Java, containers with fewer than 32 positions are written sparse and the rest dense.
EncodePforBytes()picks the PFOR bit widths (Appendix A) the way the Java encoder does, so the output matches Java byte for byte.Tests check the output against the Java-generated fixtures from #1126 (130 PFOR vectors and 6 bitmaps). They also round-trip empty, contiguous, clustered, random and maximum-size bitmaps through
MumblingBitmapView, and cover merging bitmaps of different sizes and invalid positions.BM_PforEncode,BM_SetandBM_Serializeare added tomumbling_bitmap_benchmark.Benchmark against the Java writer on the same positions (Release; gcc-14 with Google Benchmark, JDK 17 with JMH; Xeon Platinum 8175M):
Set100,000 random positionsSetall 2,097,152 positionsSerialize, 1,000 random positionsSerialize, 100,000 random positionsSerialize, all 2,097,152 positionsC++ keeps each container as a bit set, so
Setis constant-time but writing a sparse container needs a bit scan. Java keeps sparse containers as sorted lists, which is why it serializes the random 100,000-position bitmap faster.