Whether c_struct or any of its descendents have non-null data pointers.
| 142 | |
| 143 | // Whether c_struct or any of its descendents have non-null data pointers. |
| 144 | bool 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 | |
| 161 | static const std::vector<std::string> kMetadataKeys1{"key1", "key2"}; |
| 162 | static const std::vector<std::string> kMetadataValues1{"", "bar"}; |