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

Method Allocate

r/src/array_to_vector.cpp:1007–1024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1005 : Converter(chunked_array), value_type_(value_type) {}
1006
1007 SEXP Allocate(R_xlen_t n) const {
1008 cpp11::writable::list res(n);
1009
1010 if (std::is_same<ListArrayType, MapArray>::value) {
1011 res.attr(R_ClassSymbol) = arrow::r::data::classes_arrow_list;
1012 } else if (std::is_same<ListArrayType, ListArray>::value) {
1013 res.attr(R_ClassSymbol) = arrow::r::data::classes_arrow_list;
1014 } else {
1015 res.attr(R_ClassSymbol) = arrow::r::data::classes_arrow_large_list;
1016 }
1017
1018 std::shared_ptr<arrow::Array> array = CreateEmptyArray(value_type_);
1019
1020 // convert to an R object to store as the list' ptype
1021 res.attr(arrow::r::symbols::ptype) = Converter::Convert(array);
1022
1023 return res;
1024 }
1025
1026 Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const {
1027 // nothing to do, list contain NULL by default

Callers

nothing calls this directly

Calls 2

CreateEmptyArrayFunction · 0.85
ConvertFunction · 0.50

Tested by

no test coverage detected