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

Function GetCompressionExperimental

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

Source from the content-addressed store, hash-verified

775}
776
777Status GetCompressionExperimental(const flatbuf::Message* message,
778 Compression::type* out) {
779 *out = Compression::UNCOMPRESSED;
780 if (message->custom_metadata() != nullptr) {
781 // TODO: Ensure this deserialization only ever happens once
782 std::shared_ptr<KeyValueMetadata> metadata;
783 ARROW_ASSIGN_OR_RAISE(metadata,
784 internal::GetKeyValueMetadata(message->custom_metadata()));
785 int index = metadata->FindKey("ARROW:experimental_compression");
786 if (index != -1) {
787 // Arrow 0.17 stored string in upper case, internal utils now require lower case
788 auto name = arrow::internal::AsciiToLower(metadata->value(index));
789 ARROW_ASSIGN_OR_RAISE(*out, util::Codec::GetCompressionType(name));
790 }
791 return internal::CheckCompressionSupported(*out);
792 }
793 return Status::OK();
794}
795
796Status ReadContiguousPayload(io::InputStream* file, std::unique_ptr<Message>* message) {
797 ARROW_ASSIGN_OR_RAISE(*message, ReadMessage(file));

Callers 3

ReadRecordBatchInternalFunction · 0.85
ReadDictionaryFunction · 0.85
GetIpcReadContextMethod · 0.85

Calls 8

AsciiToLowerFunction · 0.85
FindKeyMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.70
GetKeyValueMetadataFunction · 0.70
OKFunction · 0.50
custom_metadataMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected