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

Function GetMetadata

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

Source from the content-addressed store, hash-verified

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

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