| 128 | |
| 129 | template <typename SetNonNull, typename SetNull> |
| 130 | Status IngestSome(const std::shared_ptr<arrow::Array>& array, R_xlen_t n, |
| 131 | SetNonNull&& set_non_null, SetNull&& set_null) { |
| 132 | if (array->null_count()) { |
| 133 | internal::BitmapReader bitmap_reader(array->null_bitmap()->data(), array->offset(), |
| 134 | n); |
| 135 | |
| 136 | for (R_xlen_t i = 0; i < n; i++, bitmap_reader.Next()) { |
| 137 | if (bitmap_reader.IsSet()) { |
| 138 | RETURN_NOT_OK(set_non_null(i)); |
| 139 | } else { |
| 140 | RETURN_NOT_OK(set_null(i)); |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | } else { |
| 145 | for (R_xlen_t i = 0; i < n; i++) { |
| 146 | RETURN_NOT_OK(set_non_null(i)); |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | return Status::OK(); |
| 151 | } |
| 152 | |
| 153 | template <typename SetNonNull> |
| 154 | Status IngestSome(const std::shared_ptr<arrow::Array>& array, R_xlen_t n, |
no test coverage detected