| 166 | |
| 167 | template <typename C_TYPE, typename A_TYPE, SelectionVector::Mode mode> |
| 168 | Status SelectionVectorImpl<C_TYPE, A_TYPE, mode>::ValidateBuffer( |
| 169 | int64_t max_slots, std::shared_ptr<arrow::Buffer> buffer) { |
| 170 | ARROW_RETURN_IF(!buffer->is_mutable(), |
| 171 | Status::Invalid("buffer for selection vector must be mutable")); |
| 172 | |
| 173 | const int64_t min_len = max_slots * sizeof(C_TYPE); |
| 174 | ARROW_RETURN_IF(buffer->size() < min_len, |
| 175 | Status::Invalid("Buffer for selection vector is too small")); |
| 176 | |
| 177 | return Status::OK(); |
| 178 | } |
| 179 | |
| 180 | } // namespace gandiva |