Skip to content

[Format] Clarify that a compressed IPC buffer can be empty for empty data #47918

@pitrou

Description

@pitrou

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:

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:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions