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

Method Allocate

r/src/array_to_vector.cpp:1122–1137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1120 MakeListValuesConverter<ListArrayType>(chunked_array, value_type)) {}
1121
1122 SEXP Allocate(R_xlen_t n) const {
1123 cpp11::writable::list res(n);
1124
1125 if (std::is_same<ListArrayType, MapArray>::value) {
1126 res.attr(R_ClassSymbol) = arrow::r::data::classes_arrow_list;
1127 } else if (std::is_same<ListArrayType, ListArray>::value) {
1128 res.attr(R_ClassSymbol) = arrow::r::data::classes_arrow_list;
1129 } else {
1130 res.attr(R_ClassSymbol) = arrow::r::data::classes_arrow_large_list;
1131 }
1132
1133 // an empty R object of the type of the elements, stored as the list's ptype
1134 res.attr(arrow::r::symbols::ptype) = values_converter_->AllocateSlice(0);
1135
1136 return res;
1137 }
1138
1139 Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const {
1140 // nothing to do, list contain NULL by default

Callers

nothing calls this directly

Calls 1

AllocateSliceMethod · 0.45

Tested by

no test coverage detected