summaryrefslogtreecommitdiff
path: root/jstests/aggregation
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/aggregation')
-rw-r--r--jstests/aggregation/sources/unionWith/unionWith_explain.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/jstests/aggregation/sources/unionWith/unionWith_explain.js b/jstests/aggregation/sources/unionWith/unionWith_explain.js
index c6fce817c4d..bc52bb81de0 100644
--- a/jstests/aggregation/sources/unionWith/unionWith_explain.js
+++ b/jstests/aggregation/sources/unionWith/unionWith_explain.js
@@ -12,6 +12,13 @@ load("jstests/aggregation/extras/utils.js"); // arrayEq, documentEq
load("jstests/libs/fixture_helpers.js"); // For FixtureHelpers.
load("jstests/libs/analyze_plan.js"); // For getAggPlanStage.
+const sbeGroupPushdownEnabled = function() {
+ const res =
+ assert.commandWorked(db.adminCommand({getParameter: 1, featureFlagSBEGroupPushdown: 1}));
+ return res.hasOwnProperty("featureFlagSBEGroupPushdown") &&
+ res.featureFlagSBEGroupPushdown.value;
+}();
+
const testDB = db.getSiblingDB(jsTestName());
const collA = testDB.A;
collA.drop();
@@ -100,6 +107,13 @@ function assertExplainEq(unionExplain, regularExplain) {
}
function testPipeline(pipeline) {
+ // When the SBE $group pushdown feature is enabled, a $group alone is pushed down but it is not
+ // when it's in $unionWith sub-pipeline. So, we don't need test such scenarios for now.
+ // Eventually such scenarios should be enabled.
+ if (sbeGroupPushdownEnabled && pipeline.some(stage => stage.hasOwnProperty("$group"))) {
+ return;
+ }
+
let unionResult = collA.aggregate([{$unionWith: {coll: collB.getName(), pipeline: pipeline}}],
{explain: true});
let queryResult = collB.aggregate(pipeline, {explain: true});