summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorYoonsoo Kim <yoonsoo.kim@mongodb.com>2021-10-19 20:46:22 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-19 21:52:19 +0000
commit92648d2ee790daa639b0010075a9df5f2cf57dfa (patch)
tree116dbb0f35f3360c69b670b6f4d3bde5f809e36c /src/mongo/db/pipeline
parent93fc544da4f7752a5ce2ab2166e94c50ea70221f (diff)
downloadmongo-92648d2ee790daa639b0010075a9df5f2cf57dfa.tar.gz
SERVER-59070 Support `needsMerge` behavior in $group pushed down to SBE
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/document_source_group.cpp7
-rw-r--r--src/mongo/db/pipeline/pipeline_d.cpp1
2 files changed, 1 insertions, 7 deletions
diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp
index 99f3aabc6a7..73f3a76d81d 100644
--- a/src/mongo/db/pipeline/document_source_group.cpp
+++ b/src/mongo/db/pipeline/document_source_group.cpp
@@ -489,12 +489,7 @@ intrusive_ptr<DocumentSource> DocumentSourceGroup::createFromBson(
BSONObj groupObj(elem.Obj());
BSONObjIterator groupIterator(groupObj);
VariablesParseState vps = expCtx->variablesParseState;
- // The 'needsMerge' behavior is not implemented for any accumulators and so $group can't be
- // pushed down to SBE when 'needsMerge' behavior is requested from the mongos.
- //
- // TODO SERVER-59070 Set 'sbeGroupCompatible' to true after implementing 'needsMerge' behavior
- // for all accumulators.
- expCtx->sbeGroupCompatible = !expCtx->needsMerge;
+ expCtx->sbeGroupCompatible = true;
while (groupIterator.more()) {
BSONElement groupField(groupIterator.next());
StringData pFieldName = groupField.fieldNameStringData();
diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp
index dfc8d2abedb..ab2b3d1cc76 100644
--- a/src/mongo/db/pipeline/pipeline_d.cpp
+++ b/src/mongo/db/pipeline/pipeline_d.cpp
@@ -150,7 +150,6 @@ std::vector<std::unique_ptr<InnerPipelineStageInterface>> extractSbeCompatibleGr
auto groupStage = dynamic_cast<DocumentSourceGroup*>(itr->get());
if (!(groupStage && groupStage->sbeCompatible()) || groupStage->doingMerge()) {
// Only pushdown a prefix of group stages that are supported by sbe.
- // TODO: SERVER-59070 remove the 'doingMerge' check when we support merging.
break;
}
groupsForPushdown.push_back(std::make_unique<InnerPipelineStageImpl>(groupStage));