| 754 | } |
| 755 | |
| 756 | SEXP Allocate(R_xlen_t n) const { |
| 757 | // allocate a data frame column to host each array |
| 758 | // If possible, a column is dealt with directly with altrep |
| 759 | auto type = |
| 760 | checked_cast<const arrow::StructType*>(this->chunked_array_->type().get()); |
| 761 | auto out = |
| 762 | arrow::r::to_r_list(converters, [n](const std::shared_ptr<Converter>& converter) { |
| 763 | SEXP out = converter->MaybeAltrep(); |
| 764 | if (Rf_isNull(out)) { |
| 765 | out = converter->Allocate(n); |
| 766 | } |
| 767 | return out; |
| 768 | }); |
| 769 | auto colnames = arrow::r::to_r_strings( |
| 770 | type->fields(), |
| 771 | [](const std::shared_ptr<Field>& field) { return field->name(); }); |
| 772 | out.attr(symbols::row_names) = arrow::r::short_row_names(static_cast<int>(n)); |
| 773 | out.attr(R_NamesSymbol) = colnames; |
| 774 | out.attr(R_ClassSymbol) = arrow::r::data::classes_tbl_df; |
| 775 | |
| 776 | return out; |
| 777 | } |
| 778 | |
| 779 | Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { |
| 780 | int nf = static_cast<int>(converters.size()); |
nothing calls this directly
no test coverage detected