| 303 | } |
| 304 | |
| 305 | inline Status ValidateShape(const std::vector<int64_t>& shape) const override { |
| 306 | ARROW_RETURN_NOT_OK(SparseIndex::ValidateShape(shape)); |
| 307 | |
| 308 | if (shape.size() < 2) { |
| 309 | return Status::Invalid("shape length is too short"); |
| 310 | } |
| 311 | |
| 312 | if (shape.size() > 2) { |
| 313 | return Status::Invalid("shape length is too long"); |
| 314 | } |
| 315 | |
| 316 | if (indptr_->shape()[0] == shape[static_cast<int64_t>(kCompressedAxis)] + 1) { |
| 317 | return Status::OK(); |
| 318 | } |
| 319 | |
| 320 | return Status::Invalid("shape length is inconsistent with the ", ToString()); |
| 321 | } |
| 322 | |
| 323 | protected: |
| 324 | std::shared_ptr<Tensor> indptr_; |