Repository navigation
feat(ipc): Read and write DictionaryEncoding.custom_metadata for dictionary values - #972
Draft
rustyconover wants to merge 2 commits into
Draft
rustyconover wants to merge 2 commits into
rustyconover wants to merge 2 commits into
Conversation
Regenerated with dev/update_fbs.sh (flatcc e3e44836) from apache/arrow main, with whitespace cleaned by the pre-commit hooks. This picks up the upstream .fbs changes since apache#854, which only change comments (e.g. the docstring fixes from apache/arrow#50826 and the Tensor/SparseTensor deprecation notes from apache/arrow#51102). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 16, 2026
Draft
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #972 +/- ##
==========================================
- Coverage 78.24% 78.15% -0.10%
==========================================
Files 106 106
Lines 16901 16932 +31
Branches 2012 2040 +28
==========================================
+ Hits 13224 13233 +9
Misses 2435 2435
- Partials 1242 1264 +22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ionary values Implements the draft Arrow format 1.6 change from apache/arrow#49704 (apache/arrow#53994): an optional custom_metadata on DictionaryEncoding that holds the metadata of the dictionary value type. It is the IPC counterpart of ArrowSchema.dictionary->metadata, and Field.custom_metadata corresponds to the parent ArrowSchema's metadata. - flatcc_generated.h is regenerated with dev/update_fbs.sh (flatcc e3e44836) from apache/arrow main plus the draft Schema.fbs change. - The encoder writes schema->dictionary->metadata (all keys) to DictionaryEncoding.custom_metadata, omitted when it is NULL or empty, and keeps writing schema->metadata to Field.custom_metadata. Before, the value metadata was dropped. - The decoder sets schema->dictionary->metadata from DictionaryEncoding.custom_metadata and keeps Field.custom_metadata on the parent schema, as before. This covers nested dictionaries and footer decoding. Footer encoding carries the member when the caller fills footer.dictionaries. - The integration JSON reader and writer support the optional "metadata" of a field's "dictionary" object, and the JSON comparison compares the dictionary value metadata, including nested dictionaries. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
rustyconover
force-pushed
the
gh-49704-dictionary-value-metadata
branch
from
October 16, 2026 22:14
7a26ce5 to
a3edfdd
Compare
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.
Draft until the Arrow format vote. This implements the proposed Arrow format 1.6 change from apache/arrow#49704. The companion drafts are apache/arrow#53994 (format and C++), apache/arrow-go#1381 (Go) and apache/arrow-rs#11622 (Rust).
DictionaryEncodinggains an optionalcustom_metadatathat holds the metadata of the dictionary value type. It is the IPC counterpart ofArrowSchema.dictionary->metadata, whileField.custom_metadatacorresponds to the parentArrowSchema.metadata. Because nanoarrow works onArrowSchemadirectly, the mapping is lossless. The member has the same semantics asField.custom_metadata, applied to the dictionary values, so this PR writes and reads all keys ofArrowSchema.dictionary->metadata.flatcc_generated.hwithdev/update_fbs.sh(flatcc e3e44836).schema->dictionary->metadata(all keys) toDictionaryEncoding.custom_metadata, omitted when NULL or empty, and keeps writingschema->metadatatoField.custom_metadata. Previously the value metadata was silently dropped.Field.custom_metadataon the parent schema, as before, and now setsschema->dictionary->metadatafromDictionaryEncoding.custom_metadata.footer.dictionaries. nanoarrow's file writer doesn't fill it (Support dictionary-encoded types in the IPC writer #622), so nanoarrow doesn't write IPC files with dictionaries today."metadata"of a field's"dictionary"object.TestingJSONComparisonnow compares dictionary value metadata at any depth, treating empty as absent.Tests:
NANOARROW_BUILD_TESTS_WITH_ARROW,dictionary(int32, uuid)cases are enabled, including Arrow C++ reading nanoarrow-encoded schemas.Archery: with the
dictionary_extensioncase enabled for nanoarrow, C Data passes between C++ and nanoarrow in both directions. On main, nanoarrow→C++ fails because the value metadata is lost. IPC integration for dictionary cases is still blocked by existing writer limitations tracked in #622, which also affect the existingdictionarycase.This PR's code and description were written by AI (Claude Code) and reviewed by a human maintainer and an AI reviewer.
🤖 Generated with Claude Code