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

Method Finalize

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

Source from the content-addressed store, hash-verified

2162 }
2163
2164 Result<Datum> Finalize() override {
2165 std::unique_ptr<ArrayBuilder> builder;
2166 RETURN_NOT_OK(MakeBuilder(ctx_->memory_pool(), list(null()), &builder));
2167 auto list_builder = checked_cast<ListBuilder*>(builder.get());
2168 auto value_builder = checked_cast<NullBuilder*>(list_builder->value_builder());
2169 const int64_t* counts = counts_.data();
2170
2171 for (int64_t group = 0; group < num_groups_; ++group) {
2172 RETURN_NOT_OK(list_builder->Append(true));
2173 RETURN_NOT_OK(value_builder->AppendNulls(counts[group]));
2174 }
2175 return list_builder->Finish();
2176 }
2177
2178 std::shared_ptr<DataType> out_type() const override { return list(null()); }
2179

Callers

nothing calls this directly

Calls 9

listFunction · 0.85
MakeBuilderFunction · 0.50
memory_poolMethod · 0.45
getMethod · 0.45
value_builderMethod · 0.45
dataMethod · 0.45
AppendMethod · 0.45
AppendNullsMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected