lidavidm commented on a change in pull request #10876:
URL: https://github.com/apache/arrow/pull/10876#discussion_r692480203
##########
File path: cpp/src/arrow/compute/kernels/hash_aggregate.cc
##########
@@ -1828,6 +1828,120 @@ struct GroupedAllImpl : public GroupedAggregator {
TypedBufferBuilder<bool> seen_;
};
+// ----------------------------------------------------------------------
+// CountDistinct/Distinct implementation
+
+struct GroupedCountDistinctImpl : public GroupedAggregator {
+ Status Init(ExecContext* ctx, const FunctionOptions* options) override {
+ ctx_ = ctx;
+ pool_ = ctx->memory_pool();
+ return Status::OK();
+ }
+
+ Status Resize(int64_t new_num_groups) override {
+ num_groups_ = new_num_groups;
Review comment:
The keys here are pairs of `[value, group_id]` so just having the number
of groups doesn't give much of a capacity hint.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]