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

Method FinishInternal

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

Source from the content-addressed store, hash-verified

442 }
443
444 Status FinishInternal(std::shared_ptr<ArrayData>* out) override {
445 // Offset and sizes padding zeroed by BufferBuilder
446 std::shared_ptr<Buffer> null_bitmap;
447 std::shared_ptr<Buffer> offsets;
448 std::shared_ptr<Buffer> sizes;
449 ARROW_RETURN_NOT_OK(this->null_bitmap_builder_.Finish(&null_bitmap));
450 ARROW_RETURN_NOT_OK(this->offsets_builder_.Finish(&offsets));
451 ARROW_RETURN_NOT_OK(this->sizes_builder_.Finish(&sizes));
452
453 if (this->value_builder_->length() == 0) {
454 // Try to make sure we get a non-null values buffer (ARROW-2744)
455 ARROW_RETURN_NOT_OK(this->value_builder_->Resize(0));
456 }
457
458 std::shared_ptr<ArrayData> items;
459 ARROW_RETURN_NOT_OK(this->value_builder_->FinishInternal(&items));
460
461 *out = ArrayData::Make(this->type(), this->length_,
462 {std::move(null_bitmap), std::move(offsets), std::move(sizes)},
463 {std::move(items)}, this->null_count_);
464 this->Reset();
465 return Status::OK();
466 }
467
468 protected:
469 void UnsafeAppendEmptyDimensions(int64_t num_values) override {

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected