MCPcopy Create free account
hub / github.com/apache/arrow / GetBodyCompression

Function GetBodyCompression

cpp/src/arrow/ipc/metadata_internal.cc:1027–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1025}
1026
1027static Status GetBodyCompression(FBB& fbb, const IpcWriteOptions& options,
1028 BodyCompressionOffset* out) {
1029 if (options.codec != nullptr) {
1030 flatbuf::CompressionType codec;
1031 if (options.codec->compression_type() == Compression::LZ4_FRAME) {
1032 codec = flatbuf::CompressionType::CompressionType_LZ4_FRAME;
1033 } else if (options.codec->compression_type() == Compression::ZSTD) {
1034 codec = flatbuf::CompressionType::CompressionType_ZSTD;
1035 } else {
1036 return Status::Invalid("Unsupported IPC compression codec: ",
1037 options.codec->name());
1038 }
1039 *out = flatbuf::CreateBodyCompression(
1040 fbb, codec, flatbuf::BodyCompressionMethod::BodyCompressionMethod_BUFFER);
1041 }
1042 return Status::OK();
1043}
1044
1045static Status MakeRecordBatch(FBB& fbb, int64_t length, int64_t body_length,
1046 const std::vector<FieldMetadata>& nodes,

Callers 1

MakeRecordBatchFunction · 0.85

Calls 5

CreateBodyCompressionFunction · 0.85
InvalidFunction · 0.50
OKFunction · 0.50
compression_typeMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected