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

Method FinishInternal

cpp/src/arrow/array/builder_nested.h:336–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334 }
335
336 Status FinishInternal(std::shared_ptr<ArrayData>* out) override {
337 ARROW_RETURN_NOT_OK(AppendNextOffset());
338
339 // Offset padding zeroed by BufferBuilder
340 std::shared_ptr<Buffer> offsets;
341 std::shared_ptr<Buffer> null_bitmap;
342 ARROW_RETURN_NOT_OK(this->offsets_builder_.Finish(&offsets));
343 ARROW_RETURN_NOT_OK(this->null_bitmap_builder_.Finish(&null_bitmap));
344
345 if (this->value_builder_->length() == 0) {
346 // Try to make sure we get a non-null values buffer (ARROW-2744)
347 ARROW_RETURN_NOT_OK(this->value_builder_->Resize(0));
348 }
349
350 std::shared_ptr<ArrayData> items;
351 ARROW_RETURN_NOT_OK(this->value_builder_->FinishInternal(&items));
352
353 *out = ArrayData::Make(this->type(), this->length_,
354 {std::move(null_bitmap), std::move(offsets)},
355 {std::move(items)}, this->null_count_);
356 this->Reset();
357 return Status::OK();
358 }
359};
360
361/// \class ListBuilder

Callers 1

FinishInternalMethod · 0.45

Calls 7

MakeFunction · 0.70
OKFunction · 0.50
FinishMethod · 0.45
lengthMethod · 0.45
ResizeMethod · 0.45
typeMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected