summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoonsoo Kim <yoonsoo.kim@mongodb.com>2021-09-22 18:09:42 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-22 18:32:52 +0000
commitea575e9768e5df64d3855b1392abb180c734387f (patch)
treea640771858604d5a9d43047775132d8830b1eba6
parent33b918c720a50ea880f68d65b908fc8771eb07df (diff)
downloadmongo-ea575e9768e5df64d3855b1392abb180c734387f.tar.gz
SERVER-60140 Disable explain tests for $group sub-pipeline with $unionWith
-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});