Skip to content

Commit

Permalink
Add withCompanionFunctions for SetAgg
Browse files Browse the repository at this point in the history
  • Loading branch information
ulysses-you committed Feb 29, 2024
1 parent 96448fe commit 39b0f11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ extern void registerMaxDataSizeForStatsAggregate(const std::string& prefix);
extern void registerMultiMapAggAggregate(const std::string& prefix);
extern void registerSumDataSizeForStatsAggregate(const std::string& prefix);
extern void registerReduceAgg(const std::string& prefix);
extern void registerSetAggAggregate(const std::string& prefix);
extern void registerSetAggAggregate(
const std::string& prefix,
bool withCompanionFunctions);
extern void registerSetUnionAggregate(const std::string& prefix);

extern void registerApproxDistinctAggregates(
Expand Down Expand Up @@ -108,7 +110,7 @@ void registerAllAggregateFunctions(
registerMinMaxAggregates(prefix, withCompanionFunctions, overwrite);
registerMinMaxByAggregates(prefix);
registerReduceAgg(prefix);
registerSetAggAggregate(prefix);
registerSetAggAggregate(prefix, withCompanionFunctions);
registerSetUnionAggregate(prefix);
registerSumAggregate(prefix);
registerVarianceAggregates(prefix, withCompanionFunctions, overwrite);
Expand Down
7 changes: 5 additions & 2 deletions velox/functions/prestosql/aggregates/SetAggregates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ std::unique_ptr<exec::Aggregate> create(

} // namespace

void registerSetAggAggregate(const std::string& prefix) {
void registerSetAggAggregate(
const std::string& prefix,
bool withCompanionFunctions) {
std::vector<std::shared_ptr<exec::AggregateFunctionSignature>> signatures = {
exec::AggregateFunctionSignatureBuilder()
.typeVariable("T")
Expand Down Expand Up @@ -491,7 +493,8 @@ void registerSetAggAggregate(const std::string& prefix) {
VELOX_UNREACHABLE(
"Unexpected type {}", mapTypeKindToName(typeKind));
}
});
},
withCompanionFunctions);
}

void registerSetUnionAggregate(const std::string& prefix) {
Expand Down

0 comments on commit 39b0f11

Please sign in to comment.