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

Method Extend

r/src/r_to_arrow.cpp:1077–1098  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1075class RListConverter : public ListConverter<T, RConverter, RConverterTrait> {
1076 public:
1077 Status Extend(SEXP x, int64_t size, int64_t offset = 0) override {
1078 RETURN_NOT_OK(this->Reserve(size));
1079
1080 RVectorType rtype = GetVectorType(x);
1081 if (rtype != LIST) {
1082 return Status::Invalid("Cannot convert to list type");
1083 }
1084
1085 auto append_null = [this]() { return this->list_builder_->AppendNull(); };
1086
1087 auto append_value = [this](SEXP value) {
1088 // TODO: if we decide that this can be run concurrently
1089 // we'll have to do vec_size() upfront
1090 R_xlen_t n = arrow::r::vec_size(value);
1091
1092 RETURN_NOT_OK(this->list_builder_->ValidateOverflow(n));
1093 RETURN_NOT_OK(this->list_builder_->Append());
1094 return this->value_converter_.get()->Extend(value, n);
1095 };
1096
1097 return VisitVector(RVectorIterator<SEXP>(x, offset), size, append_null, append_value);
1098 }
1099
1100 void DelayedExtend(SEXP values, int64_t size, RTasks& tasks) override {
1101 // NOTE: because Extend::[]append_value() calls Extend() on the

Callers 1

DelayedExtendMethod · 0.95

Calls 10

GetVectorTypeFunction · 0.85
vec_sizeFunction · 0.85
VisitVectorFunction · 0.85
InvalidClass · 0.50
ReserveMethod · 0.45
AppendNullMethod · 0.45
ValidateOverflowMethod · 0.45
AppendMethod · 0.45
ExtendMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected