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

Function GetMetadata

cpp/src/arrow/testing/random.cc:722–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720// a given metadata key.
721template <typename T, typename ArrowType = typename CTypeTraits<T>::ArrowType>
722enable_if_parameter_free<ArrowType, T> GetMetadata(const KeyValueMetadata* metadata,
723 const std::string& key,
724 T default_value) {
725 if (!metadata) return default_value;
726 const auto index = metadata->FindKey(key);
727 if (index < 0) return default_value;
728 const auto& value = metadata->value(index);
729 T output{};
730 if (!internal::ParseValue<ArrowType>(value.data(), value.length(), &output)) {
731 ABORT_NOT_OK(Status::Invalid("Could not parse ", key, " = ", value, " as ",
732 ArrowType::type_name()));
733 }
734 return output;
735}
736
737/// \brief Shuffle a list-view array in place using the Fisher–Yates algorithm [1].
738///

Callers

nothing calls this directly

Calls 6

FindKeyMethod · 0.80
InvalidFunction · 0.50
type_nameFunction · 0.50
valueMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected