ump45nose opened a new pull request, #994:
URL: https://github.com/apache/arrow-nanoarrow/pull/994

   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 (`NULL` keeps the current behaviour of using the 
decoder's own), and `ArrowIpcDecoderDecodeDictionaryInternal()` 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
   
   - Added `NanoarrowIpcEncoderCompressedDictionaryBatchCustomDecompressor`, 
which reuses the compressed dictionary batch test with a counting decompressor 
(wrapping `ArrowIpcSerialDecompressor()`) set on the decoder and checks it was 
called. It fails on `main` (0 calls) and passes with this change.
   - Debug build with `NANOARROW_IPC=ON NANOARROW_BUILD_TESTS=ON 
NANOARROW_IPC_WITH_ZSTD=ON NANOARROW_IPC_WITH_LZ4=ON`: `ctest` 412/412 passed.
   - clang-format 16.0.6 (the pre-commit version) applied.
   
   This PR was prepared with AI assistance; I reviewed the changes and ran the 
checks above.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to