Skip to content

Commit d6cc592

Browse files
authored
GH-47918: [Format] Clarify that empty compressed buffers can omit the length header (#48541)
### Rationale for this change The 8-byte length header is considered optional for empty compressed buffers in Arrow C++ and other implementations. ### Are these changes tested? Not applicable. ### Are there any user-facing changes? No. * GitHub Issue: #47918 Authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
1 parent 866502e commit d6cc592

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

format/Message.fbs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct FieldNode {
4242
null_count: long;
4343
}
4444

45-
enum CompressionType:byte {
45+
enum CompressionType: byte {
4646
// LZ4 frame format, for portability, as provided by lz4frame.h or wrappers
4747
// thereof. Not to be confused with "raw" (also called "block") format
4848
// provided by lz4.h
@@ -55,14 +55,16 @@ enum CompressionType:byte {
5555
/// Provided for forward compatibility in case we need to support different
5656
/// strategies for compressing the IPC message body (like whole-body
5757
/// compression rather than buffer-level) in the future
58-
enum BodyCompressionMethod:byte {
58+
enum BodyCompressionMethod: byte {
5959
/// Each constituent buffer is first compressed with the indicated
6060
/// compressor, and then written with the uncompressed length in the first 8
6161
/// bytes as a 64-bit little-endian signed integer followed by the compressed
6262
/// buffer bytes (and then padding as required by the protocol). The
6363
/// uncompressed length may be set to -1 to indicate that the data that
6464
/// follows is not compressed, which can be useful for cases where
6565
/// compression does not yield appreciable savings.
66+
/// Also, empty buffers can optionally be written out as 0-byte compressed
67+
/// buffers, thereby omitting the 8-bytes length header.
6668
BUFFER
6769
}
6870

0 commit comments

Comments
 (0)