Skip to content

Commit

Permalink
SimpleAggregateAdapter with FunctionState prototype
Browse files Browse the repository at this point in the history
Differential Revision: D53556520
  • Loading branch information
kagamiori authored and facebook-github-bot committed Feb 8, 2024
1 parent 98c805a commit 4256ea3
Show file tree
Hide file tree
Showing 7 changed files with 748 additions and 3 deletions.
4 changes: 4 additions & 0 deletions velox/exec/Aggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ class Aggregate {
return resultType_;
}

virtual void initialize(
const TypePtr& resultType,
const std::vector<VectorPtr>& args) {}

// Returns the fixed number of bytes the accumulator takes on a group
// row. Variable width accumulators will reference the variable
// width part of the state from the fixed part.
Expand Down
2 changes: 2 additions & 0 deletions velox/exec/AggregateInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ std::vector<AggregateInfo> toAggregateInfo(
aggResultType,
operatorCtx.driverCtx()->queryConfig());

info.function->initialize(aggResultType, info.constantInputs);

if (!isStreaming) {
auto lambdas = extractLambdaInputs(aggregate);
if (!lambdas.empty()) {
Expand Down
Loading

0 comments on commit 4256ea3

Please sign in to comment.