summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/sbe_stage_builder_accumulator_test.cpp
diff options
context:
space:
mode:
authorProjjal Chanda <projjal.chanda@mongodb.com>2023-05-15 17:39:03 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-05-15 23:23:38 +0000
commit427574c5614a3a3587b4a6563823149d60e71543 (patch)
tree22afa7bd12b283fc4087cec193018fc15d95da7a /src/mongo/db/query/sbe_stage_builder_accumulator_test.cpp
parent6be86d8987dbad1c33160ef1779b598bc7cfa6b4 (diff)
downloadmongo-427574c5614a3a3587b4a6563823149d60e71543.tar.gz
SERVER-76952: Skip processing accumulator when the result is no longer affected
Diffstat (limited to 'src/mongo/db/query/sbe_stage_builder_accumulator_test.cpp')
-rw-r--r--src/mongo/db/query/sbe_stage_builder_accumulator_test.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/mongo/db/query/sbe_stage_builder_accumulator_test.cpp b/src/mongo/db/query/sbe_stage_builder_accumulator_test.cpp
index 7de06bf4e4f..f4fb59f42f5 100644
--- a/src/mongo/db/query/sbe_stage_builder_accumulator_test.cpp
+++ b/src/mongo/db/query/sbe_stage_builder_accumulator_test.cpp
@@ -1612,15 +1612,19 @@ TEST_F(SbeStageBuilderGroupTest, FirstNLastNAccumulatorSingleGroup) {
BSON_ARRAY(BSON("a" << 22 << "b" << 2)),
BSON_ARRAY(BSON("a" << 33 << "b" << 3)),
BSON_ARRAY(BSON("a" << 44 << "b" << 4))};
- runGroupAggregationTest(
- "{_id: null, x: {$firstN: {input: '$a', n: 3}}}",
- docs,
- BSON_ARRAY(BSON("_id" << BSONNULL << "x" << BSON_ARRAY(11 << 22 << 33))));
+ runGroupAggregationTest("{_id: null, x: {$firstN: {input: {a: '$a', b: '$b'}, n: 3}}}",
+ docs,
+ BSON_ARRAY(BSON("_id" << BSONNULL << "x"
+ << BSON_ARRAY(BSON("a" << 11 << "b" << 1)
+ << BSON("a" << 22 << "b" << 2)
+ << BSON("a" << 33 << "b" << 3)))));
- runGroupAggregationTest(
- "{_id: null, x: {$lastN: {input: '$a', n: 3}}}",
- docs,
- BSON_ARRAY(BSON("_id" << BSONNULL << "x" << BSON_ARRAY(22 << 33 << 44))));
+ runGroupAggregationTest("{_id: null, x: {$lastN: {input: {a: '$a', b: '$b'}, n: 3}}}",
+ docs,
+ BSON_ARRAY(BSON("_id" << BSONNULL << "x"
+ << BSON_ARRAY(BSON("a" << 22 << "b" << 2)
+ << BSON("a" << 33 << "b" << 3)
+ << BSON("a" << 44 << "b" << 4)))));
}
TEST_F(SbeStageBuilderGroupTest, FirstNLastNAccumulatorNotEnoughElement) {