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

Method Ingest_some_nulls

r/src/array_to_vector.cpp:1224–1244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1222 }
1223
1224 Status Ingest_some_nulls(SEXP data, const std::shared_ptr<arrow::Array>& array,
1225 R_xlen_t start, R_xlen_t n, size_t chunk_index) const {
1226 auto p_values = array->data()->GetValues<int64_t>(1);
1227 if (!p_values) {
1228 return Status::Invalid("Invalid data buffer");
1229 }
1230
1231 auto p_data = reinterpret_cast<int64_t*>(REAL(data)) + start;
1232
1233 if (array->null_count()) {
1234 internal::BitmapReader bitmap_reader(array->null_bitmap()->data(), array->offset(),
1235 n);
1236 for (R_xlen_t i = 0; i < n; i++, bitmap_reader.Next(), ++p_data) {
1237 *p_data = bitmap_reader.IsSet() ? p_values[i] : NA_INT64;
1238 }
1239 } else {
1240 std::copy_n(p_values, n, p_data);
1241 }
1242
1243 return Status::OK();
1244 }
1245};
1246
1247class Converter_Null : public Converter {

Callers

nothing calls this directly

Calls 7

InvalidClass · 0.50
OKFunction · 0.50
dataMethod · 0.45
null_countMethod · 0.45
offsetMethod · 0.45
NextMethod · 0.45
IsSetMethod · 0.45

Tested by

no test coverage detected