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

Function HasData

cpp/src/arrow/c/bridge_test.cc:144–159  ·  view source on GitHub ↗

Whether c_struct or any of its descendents have non-null data pointers.

Source from the content-addressed store, hash-verified

142
143// Whether c_struct or any of its descendents have non-null data pointers.
144bool HasData(const ArrowArray* c_struct) {
145 for (int64_t i = 0; i < c_struct->n_buffers; ++i) {
146 if (c_struct->buffers[i] != nullptr) {
147 return true;
148 }
149 }
150 if (c_struct->dictionary && HasData(c_struct->dictionary)) {
151 return true;
152 }
153 for (int64_t i = 0; i < c_struct->n_children; ++i) {
154 if (HasData(c_struct->children[i])) {
155 return true;
156 }
157 }
158 return false;
159}
160
161static const std::vector<std::string> kMetadataKeys1{"key1", "key2"};
162static const std::vector<std::string> kMetadataValues1{"", "bar"};

Callers 1

CheckImportMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected