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

Function GetBodyCompression

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

Source from the content-addressed store, hash-verified

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