| 133 | : AdaptiveIntBuilderBase(start_int_size, pool, alignment) {} |
| 134 | |
| 135 | Status AdaptiveIntBuilder::FinishInternal(std::shared_ptr<ArrayData>* out) { |
| 136 | RETURN_NOT_OK(CommitPendingData()); |
| 137 | |
| 138 | std::shared_ptr<Buffer> null_bitmap; |
| 139 | RETURN_NOT_OK(null_bitmap_builder_.Finish(&null_bitmap)); |
| 140 | RETURN_NOT_OK(TrimBuffer(length_ * int_size_, data_.get())); |
| 141 | |
| 142 | std::shared_ptr<Buffer> values_buffer = data_; |
| 143 | if (!values_buffer) { |
| 144 | ARROW_ASSIGN_OR_RAISE(values_buffer, AllocateBuffer(0, pool_)); |
| 145 | } |
| 146 | |
| 147 | *out = ArrayData::Make(type(), length_, {null_bitmap, std::move(values_buffer)}, |
| 148 | null_count_); |
| 149 | |
| 150 | data_ = nullptr; |
| 151 | capacity_ = length_ = null_count_ = 0; |
| 152 | return Status::OK(); |
| 153 | } |
| 154 | |
| 155 | Status AdaptiveIntBuilder::CommitPendingData() { |
| 156 | if (pending_pos_ == 0) { |
nothing calls this directly
no test coverage detected