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

Method Ingest_some_nulls

r/src/array_to_vector.cpp:1132–1152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1130 }
1131
1132 Status Ingest_some_nulls(SEXP data, const std::shared_ptr<arrow::Array>& array,
1133 R_xlen_t start, R_xlen_t n, size_t chunk_index) const {
1134 auto p_values = array->data()->GetValues<int64_t>(1);
1135 if (!p_values) {
1136 return Status::Invalid("Invalid data buffer");
1137 }
1138
1139 auto p_data = reinterpret_cast<int64_t*>(REAL(data)) + start;
1140
1141 if (array->null_count()) {
1142 internal::BitmapReader bitmap_reader(array->null_bitmap()->data(), array->offset(),
1143 n);
1144 for (R_xlen_t i = 0; i < n; i++, bitmap_reader.Next(), ++p_data) {
1145 *p_data = bitmap_reader.IsSet() ? p_values[i] : NA_INT64;
1146 }
1147 } else {
1148 std::copy_n(p_values, n, p_data);
1149 }
1150
1151 return Status::OK();
1152 }
1153};
1154
1155class 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