| 86 | } |
| 87 | |
| 88 | Status GetTruncatedBitmap(int64_t offset, int64_t length, |
| 89 | const std::shared_ptr<Buffer>& input, MemoryPool* pool, |
| 90 | std::shared_ptr<Buffer>* buffer) { |
| 91 | if (!input) { |
| 92 | *buffer = input; |
| 93 | return Status::OK(); |
| 94 | } |
| 95 | int64_t min_length = PaddedLength(bit_util::BytesForBits(length)); |
| 96 | if (offset != 0 || min_length < input->size()) { |
| 97 | // With a sliced array / non-zero offset, we must copy the bitmap |
| 98 | ARROW_ASSIGN_OR_RAISE(*buffer, CopyBitmap(pool, input->data(), offset, length)); |
| 99 | } else { |
| 100 | *buffer = input; |
| 101 | } |
| 102 | return Status::OK(); |
| 103 | } |
| 104 | |
| 105 | Status GetTruncatedBuffer(int64_t offset, int64_t length, int32_t byte_width, |
| 106 | const std::shared_ptr<Buffer>& input, MemoryPool* pool, |
no test coverage detected