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

Method FinishInternal

cpp/src/arrow/array/builder_adaptive.cc:135–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 : AdaptiveIntBuilderBase(start_int_size, pool, alignment) {}
134
135Status 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
155Status AdaptiveIntBuilder::CommitPendingData() {
156 if (pending_pos_ == 0) {

Callers

nothing calls this directly

Calls 7

MakeFunction · 0.70
typeFunction · 0.70
ARROW_ASSIGN_OR_RAISEFunction · 0.50
AllocateBufferFunction · 0.50
OKFunction · 0.50
FinishMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected