| 180 | } |
| 181 | |
| 182 | std::shared_ptr<RecordBatch> Slice(int64_t offset, int64_t length) const override { |
| 183 | std::vector<std::shared_ptr<ArrayData>> arrays; |
| 184 | arrays.reserve(num_columns()); |
| 185 | for (const auto& field : columns_) { |
| 186 | arrays.emplace_back(field->Slice(offset, length)); |
| 187 | } |
| 188 | int64_t num_rows = std::min(num_rows_ - offset, length); |
| 189 | return std::make_shared<SimpleRecordBatch>(schema_, num_rows, std::move(arrays), |
| 190 | device_type_, sync_event_); |
| 191 | } |
| 192 | |
| 193 | Status Validate() const override { |
| 194 | if (static_cast<int>(columns_.size()) != schema_->num_fields()) { |
nothing calls this directly
no test coverage detected