| 131 | } |
| 132 | |
| 133 | ExecBatch ExecBatch::Slice(int64_t offset, int64_t length) const { |
| 134 | ExecBatch out = *this; |
| 135 | for (auto& value : out.values) { |
| 136 | if (value.is_scalar()) { |
| 137 | // keep value as is |
| 138 | } else if (value.is_array()) { |
| 139 | value = value.array()->Slice(offset, length); |
| 140 | } else if (value.is_chunked_array()) { |
| 141 | value = value.chunked_array()->Slice(offset, length); |
| 142 | } else { |
| 143 | ARROW_DCHECK(false); |
| 144 | } |
| 145 | } |
| 146 | out.length = std::min(length, this->length - offset); |
| 147 | return out; |
| 148 | } |
| 149 | |
| 150 | Result<ExecBatch> ExecBatch::SelectValues(const std::vector<int>& ids) const { |
| 151 | std::vector<Datum> selected_values; |