- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.9k
Open
Description
Describe the bug, including details regarding any error messages, version, and platform.
The Flatbuffers spec stipulates that every compressed buffer should be prefixed with the 8-byte uncompressed length.
However, in the C++ IPC writer, we actually write an empty compressed buffer (without length prefix) if the uncompressed data is empty:
arrow/cpp/src/arrow/ipc/writer.cc
Lines 243 to 246 in 8dd9eba
| if (out_->body_buffers[i]->size() > 0) { | |
| RETURN_NOT_OK(CompressBuffer(*out_->body_buffers[i], options_.codec.get(), | |
| &out_->body_buffers[i])); | |
| } | 
and, of course, we also handle this case in the C++ IPC reader:
arrow/cpp/src/arrow/ipc/reader.cc
Lines 513 to 515 in 8dd9eba
| if (buf == nullptr || buf->size() == 0) { | |
| return buf; | |
| } | 
We should make it clear in the Flatbuffers spec that this case is allowed.
Component(s)
Format