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

Method AppendScalarImpl

cpp/src/arrow/array/builder_dict.h:536–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534
535 template <typename IndexType>
536 Status AppendScalarImpl(const typename TypeTraits<T>::ArrayType& dict,
537 const Scalar& index_scalar, int64_t n_repeats) {
538 using ScalarType = typename TypeTraits<IndexType>::ScalarType;
539 const auto index = internal::checked_cast<const ScalarType&>(index_scalar).value;
540 if (index_scalar.is_valid && dict.IsValid(index)) {
541 const auto& value = dict.GetView(index);
542 for (int64_t i = 0; i < n_repeats; i++) {
543 ARROW_RETURN_NOT_OK(Append(value));
544 }
545 return Status::OK();
546 }
547 return AppendNulls(n_repeats);
548 }
549
550 Status FinishInternal(std::shared_ptr<ArrayData>* out) override {
551 std::shared_ptr<ArrayData> dictionary;

Callers

nothing calls this directly

Calls 5

AppendFunction · 0.70
AppendNullsFunction · 0.70
OKFunction · 0.50
IsValidMethod · 0.45
GetViewMethod · 0.45

Tested by

no test coverage detected