Repository navigation
Conversation
Compressed DictionaryBatch values were decompressed by the nested dictionary decoder's default serial decompressor, so a decompressor set with ArrowIpcDecoderSetDecompressor() was ignored for dictionaries. Pass the parent decoder's decompressor down when decoding the dictionary values. Closes apache#936.
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 #936.
When a DictionaryBatch body is compressed, its values are decoded by the nested per-dictionary decoder, and that decoder always initialized its own default serial decompressor. So a decompressor set on the decoder with
ArrowIpcDecoderSetDecompressor()was used for record batches but silently ignored for dictionary batches.This passes the parent decoder's decompressor down to the nested decoder when decoding dictionary values:
ArrowIpcDecoderDecodeArrayViewInternal()now takes an optional decompressor (NULLkeeps the current behaviour of using the decoder's own), andArrowIpcDecoderDecodeDictionaryInternal()passes the parent's (initializing the default one if none was set). No public API changes.The other point in the issue, dictionary sub-decoders not inheriting the parent's metadata version, was already handled in #960 (
dictionary->decoder.metadata_version = decoder->metadata_version), so this only covers the decompressor.Testing
NanoarrowIpcEncoderCompressedDictionaryBatchCustomDecompressor, which reuses the compressed dictionary batch test with a counting decompressor (wrappingArrowIpcSerialDecompressor()) set on the decoder and checks it was called. It fails onmain(0 calls) and passes with this change.NANOARROW_IPC=ON NANOARROW_BUILD_TESTS=ON NANOARROW_IPC_WITH_ZSTD=ON NANOARROW_IPC_WITH_LZ4=ON:ctest412/412 passed.This PR was prepared with AI assistance; I reviewed the changes and ran the checks above.