| 252 | } |
| 253 | |
| 254 | Status Ingest_some_nulls(SEXP data, const std::shared_ptr<arrow::Array>& array, |
| 255 | R_xlen_t start, R_xlen_t n, size_t chunk_index) const { |
| 256 | auto p_values = array->data()->GetValues<value_type>(1); |
| 257 | if (!p_values) { |
| 258 | return Status::Invalid("Invalid data buffer"); |
| 259 | } |
| 260 | auto p_data = REAL(data) + start; |
| 261 | auto ingest_one = [&](R_xlen_t i) { |
| 262 | if constexpr (std::is_same_v<Type, HalfFloatType>) { |
| 263 | p_data[i] = arrow::util::Float16::FromBits(p_values[i]).ToDouble(); |
| 264 | } else { |
| 265 | p_data[i] = static_cast<value_type>(p_values[i]); |
| 266 | } |
| 267 | return Status::OK(); |
| 268 | }; |
| 269 | auto null_one = [&](R_xlen_t i) { |
| 270 | p_data[i] = NA_REAL; |
| 271 | return Status::OK(); |
| 272 | }; |
| 273 | |
| 274 | return IngestSome(array, n, ingest_one, null_one); |
| 275 | } |
| 276 | }; |
| 277 | |
| 278 | class Converter_Date32 : public Converter { |