Apache DataFusion SQL Query Engine
ARROW-300: [Format] Proposal for "trivial" IPC body buffer compression using either LZ4 or ZSTD codecs
Wes McKinney37e27114837a
diff --git a/format/Message.fbs b/format/Message.fbsindex 7e8e6779aa..1a7e0dfff7 100644--- a/format/Message.fbs+++ b/format/Message.fbs@@ -42,6 +42,41 @@ struct FieldNode {null_count: long;}+enum CompressionType:byte {+ // LZ4 frame format, for portability, as provided by lz4frame.h or wrappers+ // thereof. Not to be confused with "raw" (also called "block") format+ // provided by lz4.h+ LZ4_FRAME,++ // Zstandard+ ZSTD+}++/// Provided for forward compatibility in case we need to support different+/// strategies for compressing the IPC message body (like whole-body+/// compression rather than buffer-level) in the future+enum BodyCompressionMethod:byte {+ /// Each constituent buffer is first compressed with the indicated+ /// compressor, and then written with the uncompressed length in the first 8+ /// bytes as a 64-bit little-endian signed integer followed by the compressed+ /// buffer bytes (and then padding as required by the protocol). The+ /// uncompressed length may be set to -1 to indicate that the data that+ /// follows is not compressed, which can be useful for cases where+ /// compression does not yield appreciable savings.+ BUFFER+}++/// Optional compression for the memory buffers constituting IPC message+/// bodies. Intended for use with RecordBatch but could be used for other+/// message types+table BodyCompression {+ /// Compressor library+ codec: CompressionType = LZ4_FRAME;++ /// Indicates the way the record batch body was compressed+ method: BodyCompressionMethod = BUFFER;+}+/// A data header describing the shared memory layout of a "record" or "row"/// batch. Some systems call this a "row batch" internally and others a "record/// batch".@@ -60,6 +95,9 @@ table RecordBatch {/// bitmap and 1 for the values. For struct arrays, there will only be a/// single buffer for the validity (nulls) bitmapbuffers: [Buffer];++ /// Optional compression of the message body+ compression: BodyCompression;}/// For sending dictionary encoding information. Any Field can be