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

Function io___RandomAccessFile__ReadMetadata

r/src/io.cpp:95–115  ·  view source on GitHub ↗

[[arrow::export]]

Source from the content-addressed store, hash-verified

93
94// [[arrow::export]]
95cpp11::strings io___RandomAccessFile__ReadMetadata(
96 const std::shared_ptr<arrow::io::RandomAccessFile>& x) {
97 std::shared_ptr<const arrow::KeyValueMetadata> metadata =
98 ValueOrStop(x->ReadMetadata());
99 if (metadata.get() == nullptr) {
100 return cpp11::writable::strings();
101 }
102
103 cpp11::writable::strings metadata_r;
104 cpp11::writable::strings metadata_r_names;
105 metadata_r.reserve(metadata->size());
106 metadata_r_names.reserve(metadata->size());
107
108 for (int64_t i = 0; i < metadata->size(); i++) {
109 metadata_r.push_back(metadata->value(i));
110 metadata_r_names.push_back(metadata->key(i));
111 }
112
113 metadata_r.names() = metadata_r_names;
114 return metadata_r;
115}
116
117// ------ arrow::io::MemoryMappedFile
118

Calls 8

ValueOrStopFunction · 0.85
push_backMethod · 0.80
ReadMetadataMethod · 0.45
getMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
valueMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected