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

Method Ingest_some_nulls

r/src/array_to_vector.cpp:254–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
278class Converter_Date32 : public Converter {

Callers

nothing calls this directly

Calls 6

FromBitsFunction · 0.85
IngestSomeFunction · 0.85
InvalidClass · 0.50
OKFunction · 0.50
dataMethod · 0.45
ToDoubleMethod · 0.45

Tested by

no test coverage detected