Add the support of dictionnaries#91
Open
Alex-PLACET wants to merge 16 commits intosparrow-org:mainfrom
Open
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
This PR adds Apache Arrow IPC dictionary-encoding support to sparrow-ipc, covering dictionary batch emission during serialization, dictionary reconstruction during deserialization, and validation via Arrow integration fixtures.
Changes:
- Emit
DictionaryBatchmessages during stream/file serialization and include dictionary blocks in the IPC file footer. - Deserialize
DictionaryBatchmessages and reattach dictionaries to index arrays to reconstruct dictionary-encoded arrays. - Extend integration tests/fixtures to exercise dictionary streams and file footers.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/deserialize.cpp |
Adds DictionaryBatch handling, dictionary caching, and dictionary application to decoded arrays. |
src/serialize.cpp |
Adds serialize_dictionary_batch to write DictionaryBatch messages. |
src/flatbuffer_utils.cpp |
Writes dictionary encoding metadata into schema fields and builds DictionaryBatch messages. |
src/stream_file_serializer.cpp |
Writes footer with dictionary blocks tracked during file serialization. |
src/dictionary_utils.cpp |
Adds helpers for dictionary metadata parsing and fallback dictionary id generation. |
src/dictionary_tracker.cpp |
Scans record batches for dictionary-encoded columns to emit dictionaries ahead of record batches. |
src/dictionary_cache.cpp |
Caches dictionaries during deserialization for later attachment to index arrays. |
include/sparrow_ipc/serialize.hpp |
Exposes serialize_dictionary_batch API. |
include/sparrow_ipc/flatbuffer_utils.hpp |
Exposes DictionaryBatch message builder and extends create_field. |
include/sparrow_ipc/serializer.hpp |
Emits dictionary batches before record batches; tracks dictionaries. |
include/sparrow_ipc/stream_file_serializer.hpp |
Emits dictionary batches, tracks dictionary footer blocks. |
include/sparrow_ipc/dictionary_utils.hpp |
Declares dictionary metadata parsing + fallback id utility. |
include/sparrow_ipc/dictionary_tracker.hpp |
Declares dictionary discovery/tracking for serialization. |
include/sparrow_ipc/dictionary_cache.hpp |
Declares dictionary cache used by deserializer. |
tests/test_dictionary.cpp |
Adds targeted dictionary stream/file round-trip tests. |
tests/test_de_serialization_with_files.cpp |
Adds dictionary fixtures and adjusts raw-buffer comparison for dictionary arrays. |
tests/CMakeLists.txt |
Registers new dictionary test. |
CMakeLists.txt |
Adds new dictionary headers/sources to the build. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…-ipc into support_dict
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.
No description provided.