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

Function GetBitmapFromVector

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

Source from the content-addressed store, hash-verified

240
241template <typename T>
242static inline Status GetBitmapFromVector(const std::vector<T>& is_valid,
243 std::shared_ptr<Buffer>* result) {
244 size_t length = is_valid.size();
245
246 ARROW_ASSIGN_OR_RAISE(auto buffer, AllocateEmptyBitmap(length));
247
248 uint8_t* bitmap = buffer->mutable_data();
249 for (size_t i = 0; i < static_cast<size_t>(length); ++i) {
250 if (is_valid[i]) {
251 bit_util::SetBit(bitmap, i);
252 }
253 }
254
255 *result = buffer;
256 return Status::OK();
257}
258
259template <typename T>
260inline 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