| 220 | |
| 221 | template <typename RunEndCType> |
| 222 | Status RunEndEncodedBuilder::DoAppendArraySlice(const ArraySpan& array, int64_t offset, |
| 223 | int64_t length) { |
| 224 | ARROW_DCHECK(offset + length <= array.length); |
| 225 | DCHECK_GT(length, 0); |
| 226 | DCHECK(!value_run_builder_->has_open_run()); |
| 227 | |
| 228 | ree_util::RunEndEncodedArraySpan<RunEndCType> ree_span(array, array.offset + offset, |
| 229 | length); |
| 230 | const int64_t physical_offset = ree_span.PhysicalIndex(0); |
| 231 | const int64_t physical_length = |
| 232 | ree_span.PhysicalIndex(ree_span.length() - 1) + 1 - physical_offset; |
| 233 | |
| 234 | RETURN_NOT_OK(ReservePhysical(physical_length)); |
| 235 | |
| 236 | // Append all the run ends from array sliced by offset and length |
| 237 | for (auto it = ree_span.iterator(0, physical_offset); !it.is_end(ree_span); ++it) { |
| 238 | const int64_t run_end = committed_logical_length_ + it.run_length(); |
| 239 | RETURN_NOT_OK(DoAppendRunEnd<RunEndCType>(run_end)); |
| 240 | UpdateDimensions(run_end, 0); |
| 241 | } |
| 242 | |
| 243 | // Append all the values directly |
| 244 | RETURN_NOT_OK(value_run_builder_->AppendRunCompressedArraySlice( |
| 245 | ree_util::ValuesArray(array), physical_offset, physical_length)); |
| 246 | |
| 247 | return Status::OK(); |
| 248 | } |
| 249 | |
| 250 | Status RunEndEncodedBuilder::AppendArraySlice(const ArraySpan& array, int64_t offset, |
| 251 | int64_t length) { |
nothing calls this directly
no test coverage detected