summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/sbe_stage_builder_accumulator.h
diff options
context:
space:
mode:
authorRui Liu <lriuui0x0@gmail.com>2023-04-05 16:24:38 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-05 21:33:18 +0000
commite7037a0546d5f6c2eb86ad223bc2664e76453e6b (patch)
tree423aea702c3fb57ae68204c97716d221d06fb9d2 /src/mongo/db/query/sbe_stage_builder_accumulator.h
parent4afba33ecd1e472f6211b27d92b70906b34e7c0a (diff)
downloadmongo-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.h9
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