| 577 | } |
| 578 | |
| 579 | std::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 |
no test coverage detected