| 165 | } |
| 166 | |
| 167 | Result<std::shared_ptr<Scalar>> ChunkedArray::GetScalar(int64_t index) const { |
| 168 | const auto loc = chunk_resolver_.Resolve(index); |
| 169 | if (loc.chunk_index >= static_cast<int64_t>(chunks_.size())) { |
| 170 | return Status::IndexError("index with value of ", index, |
| 171 | " is out-of-bounds for chunked array of length ", length_); |
| 172 | } |
| 173 | return chunks_[loc.chunk_index]->GetScalar(loc.index_in_chunk); |
| 174 | } |
| 175 | |
| 176 | std::shared_ptr<ChunkedArray> ChunkedArray::Slice(int64_t offset, int64_t length) const { |
| 177 | ARROW_CHECK_LE(offset, length_) << "Slice offset greater than array length"; |