Repository navigation
Support DictionaryEncoding.custom_metadata (format 1.6) for dictionaries of extension types - #476
Draft
CurtHagenlocher wants to merge 1 commit into
Conversation
…ion types Implements the proposed format 1.6 change (apache/arrow#53994): the extension metadata of a dictionary's value type is written to and read from DictionaryEncoding.custom_metadata. Field.custom_metadata on a dictionary-encoded field now describes the whole dictionary type, as in Arrow C++ and arrow-go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Note
Draft until the
[VOTE]on dev@ for format version 1.6 passes. It implements the format change proposed in apache/arrow#53994, which may still change before the vote. Companion PRs: apache/arrow-go#1381, apache/arrow-rs#11622, apache/arrow-nanoarrow#972.What's Changed
In IPC,
dictionary<values=extension<X>>andextension<X, storage=dictionary<...>>serialize identically today, withARROW:extension:nameinField.custom_metadata(apache/arrow#49704). Format 1.6 adds an optionalDictionaryEncoding.custom_metadatathat holds the dictionary value type's metadata. It's the IPC counterpart ofArrowSchema.dictionary->metadata, which #474 already handles for C Data.Format
format/Schema.fbsgets the newcustom_metadata: [ KeyValue ]member ofDictionaryEncoding, as proposed upstream.Flatbuf/DictionaryEncoding.cswas regenerated with flatc 23.5.9, the version of the checked-in code. The diff is limited to the new member.Writer
ExtensionType, itsARROW:extension:nameandARROW:extension:metadataare written toDictionaryEncoding.custom_metadatainstead ofField.custom_metadata.DictionaryMemo.AddField, which only accepted aDictionaryTypefield.Reader
DictionaryEncoding.custom_metadataresolves the value type against the registry before it's wrapped in theDictionaryType.DictionaryTypehas nowhere to keep value-type metadata, so, as in Arrow C++, other keys and an unresolved extension name are dropped.Field.custom_metadatais then resolved against the whole type, so on a dictionary-encoded field it names an extension whose storage is the dictionary, as in Arrow C++ and arrow-go.Tests
flatc --jsondecodes a schema written by .NET with the new member as expected.flatcbuilt from JSON.dictionary<values=fixed_size_binary[16]>.There's no Go toolchain here, so I couldn't test against apache/arrow-go#1381.
Not included
dictionary_extensioncase yet, so archery has to keep skipping .NET for it. The app has no extension types; it passes field-level extension metadata through unchanged. A dictionary's value metadata has nowhere to live in the .NET object model, so the app needs a pass-through extension type before it can produce the case.Closes #475.
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com