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

Method AllocateSlice

r/src/array_to_vector.cpp:1291–1296  ·  view source on GitHub ↗

The conversion happens in Allocate() over the whole chunked array, so a slice can't reuse it: convert an empty slice / the slice itself on its own instead. Non-empty slices always go through ConvertSlice() below.

Source from the content-addressed store, hash-verified

1289 // can't reuse it: convert an empty slice / the slice itself on its own instead.
1290 // Non-empty slices always go through ConvertSlice() below.
1291 SEXP AllocateSlice(R_xlen_t n) const {
1292 if (n != 0) {
1293 cpp11::stop("Cannot allocate a non-empty slice of an extension array");
1294 }
1295 return Converter::Convert(chunked_array_->Slice(0, 0), false);
1296 }
1297
1298 SEXP ConvertSlice(const std::shared_ptr<Array>& slice, size_t chunk_index) const {
1299 return Converter::Convert(slice);

Callers

nothing calls this directly

Calls 3

stopFunction · 0.85
ConvertFunction · 0.50
SliceMethod · 0.45

Tested by

no test coverage detected