| 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 | }; |
nothing calls this directly
no test coverage detected