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

Method Ingest_some_nulls

r/src/array_to_vector.cpp:467–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465 }
466
467 Status Ingest_some_nulls(SEXP data, const std::shared_ptr<arrow::Array>& array,
468 R_xlen_t start, R_xlen_t n, size_t chunk_index) const {
469 auto p_data = LOGICAL(data) + start;
470 auto p_bools = array->data()->GetValues<uint8_t>(1, 0);
471 if (!p_bools) {
472 return Status::Invalid("Invalid data buffer");
473 }
474
475 arrow::internal::BitmapReader data_reader(p_bools, array->offset(), n);
476 auto ingest_one = [&](R_xlen_t i) {
477 p_data[i] = data_reader.IsSet();
478 data_reader.Next();
479 return Status::OK();
480 };
481
482 auto null_one = [&](R_xlen_t i) {
483 data_reader.Next();
484 p_data[i] = NA_LOGICAL;
485 return Status::OK();
486 };
487
488 return IngestSome(array, n, ingest_one, null_one);
489 }
490};
491
492template <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