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

Method Extend

r/src/r_to_arrow.cpp:1069–1090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1067class RListConverter : public ListConverter<T, RConverter, RConverterTrait> {
1068 public:
1069 Status Extend(SEXP x, int64_t size, int64_t offset = 0) override {
1070 RETURN_NOT_OK(this->Reserve(size));
1071
1072 RVectorType rtype = GetVectorType(x);
1073 if (rtype != LIST) {
1074 return Status::Invalid("Cannot convert to list type");
1075 }
1076
1077 auto append_null = [this]() { return this->list_builder_->AppendNull(); };
1078
1079 auto append_value = [this](SEXP value) {
1080 // TODO: if we decide that this can be run concurrently
1081 // we'll have to do vec_size() upfront
1082 R_xlen_t n = arrow::r::vec_size(value);
1083
1084 RETURN_NOT_OK(this->list_builder_->ValidateOverflow(n));
1085 RETURN_NOT_OK(this->list_builder_->Append());
1086 return this->value_converter_.get()->Extend(value, n);
1087 };
1088
1089 return VisitVector(RVectorIterator<SEXP>(x, offset), size, append_null, append_value);
1090 }
1091
1092 void DelayedExtend(SEXP values, int64_t size, RTasks& tasks) override {
1093 // 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