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

Function GetCompression

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

Source from the content-addressed store, hash-verified

738// Array loading
739
740Status GetCompression(const flatbuf::RecordBatch* batch, Compression::type* out) {
741 *out = Compression::UNCOMPRESSED;
742 const flatbuf::BodyCompression* compression = batch->compression();
743 if (compression != nullptr) {
744 if (compression->method() !=
745 flatbuf::BodyCompressionMethod::BodyCompressionMethod_BUFFER) {
746 // Forward compatibility
747 return Status::Invalid("This library only supports BUFFER compression method");
748 }
749
750 if (compression->codec() == flatbuf::CompressionType::CompressionType_LZ4_FRAME) {
751 *out = Compression::LZ4_FRAME;
752 } else if (compression->codec() == flatbuf::CompressionType::CompressionType_ZSTD) {
753 *out = Compression::ZSTD;
754 } else {
755 return Status::Invalid("Unsupported codec in RecordBatch::compression metadata");
756 }
757 return Status::OK();
758 }
759 return Status::OK();
760}
761
762Status GetCompressionExperimental(const flatbuf::Message* message,
763 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