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

Function GetBitmapFromVector

cpp/src/arrow/testing/builder.h:208–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206
207template <typename T>
208static inline Status GetBitmapFromVector(const std::vector<T>& is_valid,
209 std::shared_ptr<Buffer>* result) {
210 size_t length = is_valid.size();
211
212 ARROW_ASSIGN_OR_RAISE(auto buffer, AllocateEmptyBitmap(length));
213
214 uint8_t* bitmap = buffer->mutable_data();
215 for (size_t i = 0; i < static_cast<size_t>(length); ++i) {
216 if (is_valid[i]) {
217 bit_util::SetBit(bitmap, i);
218 }
219 }
220
221 *result = buffer;
222 return Status::OK();
223}
224
225template <typename T>
226inline void BitmapFromVector(const std::vector<T>& is_valid,

Callers 4

TESTFunction · 0.85
MakeListArrayFunction · 0.85
MakeDictionaryFunction · 0.85
BitmapFromVectorFunction · 0.85

Calls 4

SetBitFunction · 0.85
OKFunction · 0.50
sizeMethod · 0.45
mutable_dataMethod · 0.45

Tested by 3

TESTFunction · 0.68
MakeListArrayFunction · 0.68
MakeDictionaryFunction · 0.68