diff options
author | Yoonsoo Kim <yoonsoo.kim@mongodb.com> | 2021-09-22 18:09:42 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-09-22 18:32:52 +0000 |
commit | ea575e9768e5df64d3855b1392abb180c734387f (patch) | |
tree | a640771858604d5a9d43047775132d8830b1eba6 /jstests/aggregation | |
parent | 33b918c720a50ea880f68d65b908fc8771eb07df (diff) | |
download | mongo-ea575e9768e5df64d3855b1392abb180c734387f.tar.gz |
SERVER-60140 Disable explain tests for $group sub-pipeline with $unionWith
Diffstat (limited to 'jstests/aggregation')
-rw-r--r-- | jstests/aggregation/sources/unionWith/unionWith_explain.js | 14 |
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}); |