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

Method Ingest_some_nulls

r/src/array_to_vector.cpp:475–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473 }
474
475 Status Ingest_some_nulls(SEXP data, const std::shared_ptr<arrow::Array>& array,
476 R_xlen_t start, R_xlen_t n, size_t chunk_index) const {
477 const ArrayType* binary_array = checked_cast<const ArrayType*>(array.get());
478
479 auto ingest_one = [&](R_xlen_t i) {
480 offset_type ni;
481 auto value = binary_array->GetValue(i, &ni);
482 if (ni > R_XLEN_T_MAX) {
483 return Status::RError("Array too big to be represented as a raw vector");
484 }
485 SEXP raw = PROTECT(Rf_allocVector(RAWSXP, ni));
486 std::copy(value, value + ni, RAW(raw));
487
488 SET_VECTOR_ELT(data, i + start, raw);
489 UNPROTECT(1);
490
491 return Status::OK();
492 };
493
494 return IngestSome(array, n, ingest_one);
495 }
496
497 virtual bool Parallel() const { return false; }
498};

Callers

nothing calls this directly

Calls 5

RErrorFunction · 0.85
IngestSomeFunction · 0.85
OKFunction · 0.50
getMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected