| 163 | |
| 164 | template <typename SetNonNull, typename SetNull> |
| 165 | Status IngestSome(const std::shared_ptr<arrow::Array>& array, R_xlen_t n, |
| 166 | SetNonNull&& set_non_null, SetNull&& set_null) { |
| 167 | if (array->null_count()) { |
| 168 | internal::BitmapReader bitmap_reader(array->null_bitmap()->data(), array->offset(), |
| 169 | n); |
| 170 | |
| 171 | for (R_xlen_t i = 0; i < n; i++, bitmap_reader.Next()) { |
| 172 | if (bitmap_reader.IsSet()) { |
| 173 | RETURN_NOT_OK(set_non_null(i)); |
| 174 | } else { |
| 175 | RETURN_NOT_OK(set_null(i)); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | } else { |
| 180 | for (R_xlen_t i = 0; i < n; i++) { |
| 181 | RETURN_NOT_OK(set_non_null(i)); |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | return Status::OK(); |
| 186 | } |
| 187 | |
| 188 | template <typename SetNonNull> |
| 189 | Status IngestSome(const std::shared_ptr<arrow::Array>& array, R_xlen_t n, |
no test coverage detected