diff options
author | Rui Liu <lriuui0x0@gmail.com> | 2023-04-05 16:24:38 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-05 21:33:18 +0000 |
commit | e7037a0546d5f6c2eb86ad223bc2664e76453e6b (patch) | |
tree | 423aea702c3fb57ae68204c97716d221d06fb9d2 /src/mongo/db/query/sbe_stage_builder_accumulator.h | |
parent | 4afba33ecd1e472f6211b27d92b70906b34e7c0a (diff) | |
download | mongo-e7037a0546d5f6c2eb86ad223bc2664e76453e6b.tar.gz |
SERVER-75673 Extend the hashagg stage to allow initialization expression
Diffstat (limited to 'src/mongo/db/query/sbe_stage_builder_accumulator.h')
-rw-r--r-- | src/mongo/db/query/sbe_stage_builder_accumulator.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/query/sbe_stage_builder_accumulator.h b/src/mongo/db/query/sbe_stage_builder_accumulator.h index 6225bbecac1..c2ad47611b3 100644 --- a/src/mongo/db/query/sbe_stage_builder_accumulator.h +++ b/src/mongo/db/query/sbe_stage_builder_accumulator.h @@ -69,4 +69,13 @@ std::vector<std::unique_ptr<sbe::EExpression>> buildCombinePartialAggregates( std::unique_ptr<sbe::EExpression> buildFinalize(StageBuilderState& state, const AccumulationStatement& acc, const sbe::value::SlotVector& aggSlots); + +/** + * Translates an input AccumulationStatement into an SBE EExpression for the initialization of the + * accumulator state. + */ +std::vector<std::unique_ptr<sbe::EExpression>> buildInitialize( + const AccumulationStatement& acc, + std::unique_ptr<sbe::EExpression> initExpr, + boost::optional<sbe::value::SlotId> collatorSlot); } // namespace mongo::stage_builder |