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

Function TweakValidityBit

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

Source from the content-addressed store, hash-verified

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

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