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

Function Append

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

Source from the content-addressed store, hash-verified

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

Callers 1

AppendMethod · 0.70

Calls 12

ToInlineBinaryViewFunction · 0.85
ToNonInlineBinaryViewFunction · 0.85
UnsafeAppendToBitmapFunction · 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
AppendMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected