You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "PG1204 (via GitHub)" <gi...@apache.org> on 2026/07/22 06:13:05 UTC

Re: [I] [Java][IPC] AbstractCompressionCodec.compress() writes prefix=0 for empty buffers, incompatible with C++/Python readers [arrow-java]

PG1204 commented on issue #1196:
URL: https://github.com/apache/arrow-java/issues/1196#issuecomment-5042519208

   Hi @zgdgod , I'd like to pick this up.
   
   My plan is to change the empty-buffer path in AbstractCompressionCodec.compress() to write the -1 (NO_COMPRESSION_LENGTH) sentinel instead of 0, since -1 is the value C++ and PyArrow already recognize as an uncompressed buffer. I'd keep the existing decompressedLength == 0 branch in decompress() so Java can still read older streams that were written with the 0 prefix.
   
   Does that direction sound right, or would you rather drop the empty-buffer shortcut entirely and let the normal uncompressed fallback handle it? Once you confirm, I'll open a PR with a round-trip test covering an all-empty-string column.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org