| 569 | } |
| 570 | |
| 571 | std::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 |
no test coverage detected