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

Method Allocate

r/src/array_to_vector.cpp:1029–1046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1027 : Converter(chunked_array), value_type_(value_type) {}
1028
1029 SEXP Allocate(R_xlen_t n) const {
1030 cpp11::writable::list res(n);
1031
1032 if (std::is_same<ListArrayType, MapArray>::value) {
1033 res.attr(R_ClassSymbol) = arrow::r::data::classes_arrow_list;
1034 } else if (std::is_same<ListArrayType, ListArray>::value) {
1035 res.attr(R_ClassSymbol) = arrow::r::data::classes_arrow_list;
1036 } else {
1037 res.attr(R_ClassSymbol) = arrow::r::data::classes_arrow_large_list;
1038 }
1039
1040 std::shared_ptr<arrow::Array> array = CreateEmptyArray(value_type_);
1041
1042 // convert to an R object to store as the list' ptype
1043 res.attr(arrow::r::symbols::ptype) = Converter::Convert(array);
1044
1045 return res;
1046 }
1047
1048 Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const {
1049 // 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