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

Method Merge

cpp/src/arrow/compute/kernels/hash_aggregate.cc:1592–1611  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1590 }
1591
1592 Status Merge(GroupedAggregator&& raw_other,
1593 const ArrayData& group_id_mapping) override {
1594 auto other = checked_cast<GroupedOneImpl*>(&raw_other);
1595
1596 auto raw_ones = ones_.mutable_data();
1597 auto other_raw_ones = other->ones_.mutable_data();
1598
1599 auto g = group_id_mapping.GetValues<uint32_t>(1);
1600 for (uint32_t other_g = 0; static_cast<int64_t>(other_g) < group_id_mapping.length;
1601 ++other_g, ++g) {
1602 if (!bit_util::GetBit(has_one_.data(), *g)) {
1603 if (bit_util::GetBit(other->has_one_.data(), other_g)) {
1604 GetSet::Set(raw_ones, *g, GetSet::Get(other_raw_ones, other_g));
1605 bit_util::SetBit(has_one_.mutable_data(), *g);
1606 }
1607 }
1608 }
1609
1610 return Status::OK();
1611 }
1612
1613 Result<Datum> Finalize() override {
1614 ARROW_ASSIGN_OR_RAISE(auto null_bitmap, has_one_.Finish());

Callers 4

MergeFromMethod · 0.45
HashAggregateMergeFunction · 0.45
SortInternalMethod · 0.45
MergeInternalMethod · 0.45

Calls 6

SetBitFunction · 0.85
GetBitFunction · 0.50
GetFunction · 0.50
OKFunction · 0.50
mutable_dataMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected