\brief Return a one dimensional Tensor.
| 143 | |
| 144 | /// \brief Return a one dimensional Tensor. |
| 145 | Result<std::shared_ptr<Tensor>> ToTensorWithNulls() const override { |
| 146 | // Could be non-templated |
| 147 | const int64_t byte_width = type()->byte_width(); |
| 148 | std::shared_ptr<Buffer> buffer; |
| 149 | if (data_->buffers[1] != NULLPTR) { |
| 150 | // Array guarantees this will not overflow. |
| 151 | const int64_t byte_offset = data_->offset * byte_width; |
| 152 | const int64_t byte_length = length() * byte_width; |
| 153 | ARROW_ASSIGN_OR_RAISE(buffer, |
| 154 | SliceBufferSafe(data_->buffers[1], byte_offset, byte_length)); |
| 155 | } |
| 156 | return Tensor::Make(type(), std::move(buffer), {length()}); |
| 157 | } |
| 158 | |
| 159 | const value_type* values_; |
| 160 | }; |
nothing calls this directly
no test coverage detected