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