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

Method AppendArraySlice

cpp/src/arrow/array/builder_union.cc:48–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48Status DenseUnionBuilder::AppendArraySlice(const ArraySpan& array, const int64_t offset,
49 const int64_t length) {
50 const int8_t* type_codes = array.GetValues<int8_t>(1);
51 const int32_t* offsets = array.GetValues<int32_t>(2);
52 for (int64_t row = offset; row < offset + length; row++) {
53 const int8_t type_code = type_codes[row];
54 const int child_id = type_id_to_child_id_[type_code];
55 const int32_t union_offset = offsets[row];
56 RETURN_NOT_OK(Append(type_code));
57 RETURN_NOT_OK(type_id_to_children_[type_code]->AppendArraySlice(
58 array.child_data[child_id], union_offset, /*length=*/1));
59 }
60 return Status::OK();
61}
62
63Status DenseUnionBuilder::FinishInternal(std::shared_ptr<ArrayData>* out) {
64 ARROW_RETURN_NOT_OK(BasicUnionBuilder::FinishInternal(out));

Callers 15

AppendArraySliceFunction · 0.45
TEST_FFunction · 0.45
CheckAppendArraySliceMethod · 0.45
ListFromListViewImplFunction · 0.45
TEST_PFunction · 0.45
VisitMethod · 0.45
AppendListSliceValuesMethod · 0.45
ExecMethod · 0.45
ExecMethod · 0.45
ExecMethod · 0.45
CallMethod · 0.45

Calls 4

AppendFunction · 0.70
OKFunction · 0.50
sizeMethod · 0.45
AppendMethod · 0.45

Tested by 6

TEST_FFunction · 0.36
CheckAppendArraySliceMethod · 0.36
TEST_PFunction · 0.36
TestCaseWhenRandomFunction · 0.36