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

Method Ingest_some_nulls

r/src/array_to_vector.cpp:428–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426 }
427
428 Status Ingest_some_nulls(SEXP data, const std::shared_ptr<arrow::Array>& array,
429 R_xlen_t start, R_xlen_t n, size_t chunk_index) const {
430 auto p_data = LOGICAL(data) + start;
431 auto p_bools = array->data()->GetValues<uint8_t>(1, 0);
432 if (!p_bools) {
433 return Status::Invalid("Invalid data buffer");
434 }
435
436 arrow::internal::BitmapReader data_reader(p_bools, array->offset(), n);
437 auto ingest_one = [&](R_xlen_t i) {
438 p_data[i] = data_reader.IsSet();
439 data_reader.Next();
440 return Status::OK();
441 };
442
443 auto null_one = [&](R_xlen_t i) {
444 data_reader.Next();
445 p_data[i] = NA_LOGICAL;
446 return Status::OK();
447 };
448
449 return IngestSome(array, n, ingest_one, null_one);
450 }
451};
452
453template <typename ArrayType>

Callers

nothing calls this directly

Calls 7

IngestSomeFunction · 0.85
InvalidClass · 0.50
OKFunction · 0.50
dataMethod · 0.45
offsetMethod · 0.45
IsSetMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected