MCPcopy Create free account
hub / github.com/apache/arrow / DoAppendArraySlice

Method DoAppendArraySlice

cpp/src/arrow/array/builder_run_end.cc:222–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220
221template <typename RunEndCType>
222Status 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
250Status RunEndEncodedBuilder::AppendArraySlice(const ArraySpan& array, int64_t offset,
251 int64_t length) {

Callers

nothing calls this directly

Calls 9

ReservePhysicalFunction · 0.85
has_open_runMethod · 0.80
PhysicalIndexMethod · 0.80
iteratorMethod · 0.80
OKFunction · 0.50
lengthMethod · 0.45
is_endMethod · 0.45
run_lengthMethod · 0.45

Tested by

no test coverage detected