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

Function GetCompression

cpp/src/arrow/ipc/reader.cc:755–775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753// Array loading
754
755Status GetCompression(const flatbuf::RecordBatch* batch, Compression::type* out) {
756 *out = Compression::UNCOMPRESSED;
757 const flatbuf::BodyCompression* compression = batch->compression();
758 if (compression != nullptr) {
759 if (compression->method() !=
760 flatbuf::BodyCompressionMethod::BodyCompressionMethod_BUFFER) {
761 // Forward compatibility
762 return Status::Invalid("This library only supports BUFFER compression method");
763 }
764
765 if (compression->codec() == flatbuf::CompressionType::CompressionType_LZ4_FRAME) {
766 *out = Compression::LZ4_FRAME;
767 } else if (compression->codec() == flatbuf::CompressionType::CompressionType_ZSTD) {
768 *out = Compression::ZSTD;
769 } else {
770 return Status::Invalid("Unsupported codec in RecordBatch::compression metadata");
771 }
772 return Status::OK();
773 }
774 return Status::OK();
775}
776
777Status GetCompressionExperimental(const flatbuf::Message* message,
778 Compression::type* out) {

Callers 8

GetFileSourceMethod · 0.85
MakeCodecMethod · 0.85
MakeCodecMethod · 0.85
ReadRecordBatchInternalFunction · 0.85
ReadDictionaryFunction · 0.85
GetIpcReadContextMethod · 0.85
MakeCodecMethod · 0.85
TEST_PFunction · 0.85

Calls 5

methodMethod · 0.80
codecMethod · 0.80
InvalidFunction · 0.50
OKFunction · 0.50
compressionMethod · 0.45

Tested by 5

GetFileSourceMethod · 0.68
MakeCodecMethod · 0.68
MakeCodecMethod · 0.68
MakeCodecMethod · 0.68
TEST_PFunction · 0.68