| 182 | } |
| 183 | |
| 184 | Status Ingest_some_nulls(SEXP data, const std::shared_ptr<arrow::Array>& array, |
| 185 | R_xlen_t start, R_xlen_t n, size_t chunk_index) const { |
| 186 | auto p_values = array->data()->GetValues<value_type>(1); |
| 187 | if (!p_values) { |
| 188 | return Status::Invalid("Invalid data buffer"); |
| 189 | } |
| 190 | auto p_data = INTEGER(data) + start; |
| 191 | auto ingest_one = [&](R_xlen_t i) { |
| 192 | p_data[i] = static_cast<int>(p_values[i]); |
| 193 | return Status::OK(); |
| 194 | }; |
| 195 | auto null_one = [&](R_xlen_t i) { |
| 196 | p_data[i] = NA_INTEGER; |
| 197 | return Status::OK(); |
| 198 | }; |
| 199 | |
| 200 | return IngestSome(array, n, ingest_one, null_one); |
| 201 | } |
| 202 | }; |
| 203 | |
| 204 | template <typename Type> |
no test coverage detected