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

Function GetCompressionExperimental

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

Source from the content-addressed store, hash-verified

760}
761
762Status GetCompressionExperimental(const flatbuf::Message* message,
763 Compression::type* out) {
764 *out = Compression::UNCOMPRESSED;
765 if (message->custom_metadata() != nullptr) {
766 // TODO: Ensure this deserialization only ever happens once
767 std::shared_ptr<KeyValueMetadata> metadata;
768 RETURN_NOT_OK(internal::GetKeyValueMetadata(message->custom_metadata(), &metadata));
769 int index = metadata->FindKey("ARROW:experimental_compression");
770 if (index != -1) {
771 // Arrow 0.17 stored string in upper case, internal utils now require lower case
772 auto name = arrow::internal::AsciiToLower(metadata->value(index));
773 ARROW_ASSIGN_OR_RAISE(*out, util::Codec::GetCompressionType(name));
774 }
775 return internal::CheckCompressionSupported(*out);
776 }
777 return Status::OK();
778}
779
780Status ReadContiguousPayload(io::InputStream* file, std::unique_ptr<Message>* message) {
781 ARROW_ASSIGN_OR_RAISE(*message, ReadMessage(file));

Callers 3

ReadRecordBatchInternalFunction · 0.85
ReadDictionaryFunction · 0.85
GetIpcReadContextMethod · 0.85

Calls 8

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

Tested by

no test coverage detected