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

Function TweakValidityBit

cpp/src/arrow/testing/gtest_util.cc:579–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577}
578
579std::shared_ptr<Array> TweakValidityBit(const std::shared_ptr<Array>& array,
580 int64_t index, bool validity) {
581 auto data = array->data()->Copy();
582 if (data->buffers[0] == nullptr) {
583 data->buffers[0] = *AllocateBitmap(data->length);
584 bit_util::SetBitsTo(data->buffers[0]->mutable_data(), 0, data->length, true);
585 }
586 bit_util::SetBitTo(data->buffers[0]->mutable_data(), index, validity);
587 data->null_count = kUnknownNullCount;
588 // Need to return a new array, because Array caches the null bitmap pointer
589 return MakeArray(data);
590}
591
592// XXX create a testing/io.{h,cc}?
593

Callers 7

CheckFSLToFSLFunction · 0.85
TYPED_TESTFunction · 0.85
TEST_FFunction · 0.85
TYPED_TESTFunction · 0.85
TYPED_TESTFunction · 0.85
TestListFlattenMethod · 0.85
TESTFunction · 0.85

Calls 7

AllocateBitmapFunction · 0.85
MakeArrayFunction · 0.70
SetBitsToFunction · 0.50
SetBitToFunction · 0.50
CopyMethod · 0.45
dataMethod · 0.45
mutable_dataMethod · 0.45

Tested by

no test coverage detected