| 732 | } |
| 733 | |
| 734 | SEXP Allocate(R_xlen_t n) const { |
| 735 | // allocate a data frame column to host each array |
| 736 | // If possible, a column is dealt with directly with altrep |
| 737 | auto type = |
| 738 | checked_cast<const arrow::StructType*>(this->chunked_array_->type().get()); |
| 739 | auto out = |
| 740 | arrow::r::to_r_list(converters, [n](const std::shared_ptr<Converter>& converter) { |
| 741 | SEXP out = converter->MaybeAltrep(); |
| 742 | if (Rf_isNull(out)) { |
| 743 | out = converter->Allocate(n); |
| 744 | } |
| 745 | return out; |
| 746 | }); |
| 747 | auto colnames = arrow::r::to_r_strings( |
| 748 | type->fields(), |
| 749 | [](const std::shared_ptr<Field>& field) { return field->name(); }); |
| 750 | out.attr(symbols::row_names) = arrow::r::short_row_names(static_cast<int>(n)); |
| 751 | out.attr(R_NamesSymbol) = colnames; |
| 752 | out.attr(R_ClassSymbol) = arrow::r::data::classes_tbl_df; |
| 753 | |
| 754 | return out; |
| 755 | } |
| 756 | |
| 757 | Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { |
| 758 | int nf = static_cast<int>(converters.size()); |
nothing calls this directly
no test coverage detected