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

Method ConvertSlice

r/src/array_to_vector.cpp:817–828  ·  view source on GitHub ↗

Convert each child of the slice through its own converter, rather than allocating then ingesting: that lets children that can only convert whole arrays (extension types) work, and children that can be altrep be altrep

Source from the content-addressed store, hash-verified

815 // allocating then ingesting: that lets children that can only convert whole
816 // arrays (extension types) work, and children that can be altrep be altrep
817 SEXP ConvertSlice(const std::shared_ptr<Array>& slice, size_t chunk_index) const {
818 const auto& struct_array = checked_cast<const arrow::StructArray&>(*slice);
819 // Flatten() deals with merging of nulls
820 auto arrays = ValueOrStop(struct_array.Flatten(gc_memory_pool()));
821 int nf = static_cast<int>(converters.size());
822
823 cpp11::writable::list out(nf);
824 for (int i = 0; i < nf; i++) {
825 out[i] = converters[i]->ConvertSlice(arrays[i], chunk_index);
826 }
827 return FinishDataFrame(out, slice->length());
828 }
829
830 Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const {
831 int nf = static_cast<int>(converters.size());

Callers

nothing calls this directly

Calls 6

ValueOrStopFunction · 0.85
gc_memory_poolFunction · 0.85
FlattenMethod · 0.45
sizeMethod · 0.45
ConvertSliceMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected