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

Function Append

cpp/src/arrow/array/builder_binary.h:495–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493
494 template <bool Safe>
495 std::conditional_t<Safe, Result<c_type>, c_type> Append(const uint8_t* value,
496 int64_t length) {
497 if (length <= BinaryViewType::kInlineSize) {
498 return util::ToInlineBinaryView(value, static_cast<int32_t>(length));
499 }
500
501 if constexpr (Safe) {
502 ARROW_RETURN_NOT_OK(Reserve(length));
503 }
504
505 auto v = util::ToNonInlineBinaryView(value, static_cast<int32_t>(length),
506 static_cast<int32_t>(blocks_.size() - 1),
507 current_offset_);
508
509 memcpy(current_out_buffer_, value, static_cast<size_t>(length));
510 current_out_buffer_ += length;
511 current_remaining_bytes_ -= length;
512 current_offset_ += static_cast<int32_t>(length);
513 return v;
514 }
515
516 static constexpr int64_t ValueSizeLimit() {
517 return std::numeric_limits<int32_t>::max();

Callers 1

AppendMethod · 0.70

Calls 14

ToInlineBinaryViewFunction · 0.85
ToNonInlineBinaryViewFunction · 0.85
UnsafeAppendToBitmapFunction · 0.85
memory_limitFunction · 0.85
CapacityErrorFunction · 0.85
value_data_lengthMethod · 0.80
ReserveFunction · 0.70
UnsafeAppendFunction · 0.70
OKFunction · 0.50
sizeMethod · 0.45
UnsafeAppendMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected