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

Method Ingest_some_nulls

r/src/array_to_vector.cpp:514–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512 }
513
514 Status Ingest_some_nulls(SEXP data, const std::shared_ptr<arrow::Array>& array,
515 R_xlen_t start, R_xlen_t n, size_t chunk_index) const {
516 const ArrayType* binary_array = checked_cast<const ArrayType*>(array.get());
517
518 auto ingest_one = [&](R_xlen_t i) {
519 offset_type ni;
520 auto value = binary_array->GetValue(i, &ni);
521 if (ni > R_XLEN_T_MAX) {
522 return Status::RError("Array too big to be represented as a raw vector");
523 }
524 SEXP raw = PROTECT(Rf_allocVector(RAWSXP, ni));
525 std::copy(value, value + ni, RAW(raw));
526
527 SET_VECTOR_ELT(data, i + start, raw);
528 UNPROTECT(1);
529
530 return Status::OK();
531 };
532
533 return IngestSome(array, n, ingest_one);
534 }
535
536 virtual bool Parallel() const { return false; }
537};

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