feat: support write for deletion vector#158
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds write-path support for deletion vectors by introducing a generic IndexFile base and implementing deletion-vector index file writing utilities, along with extending DeletionVector/BitmapDeletionVector serialization APIs and adding unit tests for bitmap deletion vectors.
Changes:
- Add
IndexFilebase abstraction (path/exists/size/delete) for index-file operations. - Implement deletion vector index file writing (
DeletionVectorsIndexFile,DeletionVectorIndexFileWriter,DeletionFileWriter). - Extend
DeletionVector/BitmapDeletionVectorwith cardinality + stream serialization and addBitmapDeletionVectorunit tests.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/paimon/core/index/index_file.h | New base class for index-file filesystem/path operations |
| src/paimon/core/deletionvectors/deletion_vectors_index_file.h | Make DV index file derive from IndexFile and expose write entrypoint |
| src/paimon/core/deletionvectors/deletion_vectors_index_file.cpp | Implements DV index file write delegation to writer |
| src/paimon/core/deletionvectors/deletion_vector_index_file_writer.h | Declares DV index file writer (currently with unused target-size parameter) |
| src/paimon/core/deletionvectors/deletion_vector_index_file_writer.cpp | Implements writing a single DV file via DeletionFileWriter |
| src/paimon/core/deletionvectors/deletion_vector.h | Extends DV interface with GetCardinality() and SerializeTo(...) |
| src/paimon/core/deletionvectors/deletion_file_writer.h | New low-level writer producing IndexFileMeta + DV range metadata |
| src/paimon/core/deletionvectors/bitmap_deletion_vector.h | Refactors serialization declarations and adds constants |
| src/paimon/core/deletionvectors/bitmap_deletion_vector.cpp | Implements stream serialization + deserialize + bounds checking logic |
| src/paimon/core/deletionvectors/bitmap_deletion_vector_test.cpp | Adds unit tests for bitmap deletion vector behavior/serialization |
| src/paimon/CMakeLists.txt | Wires new sources and test into build |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/paimon/core/deletionvectors/deletion_vector_index_file_writer.cpp
Outdated
Show resolved
Hide resolved
src/paimon/core/deletionvectors/deletion_vector_index_file_writer.cpp
Outdated
Show resolved
Hide resolved
src/paimon/core/deletionvectors/deletion_vector_index_file_writer.h
Outdated
Show resolved
Hide resolved
|
|
||
| private: | ||
| std::shared_ptr<DeletionVectorIndexFileWriter> CreateWriter() const; | ||
|
|
There was a problem hiding this comment.
Please add some cases for DeletionVectorsIndexFile, some normal se/de cases and with external path cases to verify IndexFileMeta.
There was a problem hiding this comment.
See DeletionVectorTest.java DeletionVectorsIndexFileTest.java for references.
Purpose
Support write for deletion vectors by introducing a generic IndexFile base and implementing deletion-vector index file writing utilities, along with extending DeletionVector/BitmapDeletionVector serialization APIs and adding unit tests for bitmap deletion vectors.
Tests
BitmapDeletionVectorTest
API and Format
Documentation