[SERVER-84489] [BP] Support group-by $min/$max with multiple buckets Created: 02/Jan/24  Updated: 18/Jan/24  Resolved: 18/Jan/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Drew Paroski Assignee: Backlog - Query Execution
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-84486 Support block-based $group with $min/... Open
Assigned Teams:
Query Execution
Participants:

 Description   

Given a simple timeseries collection:

./build/install/bin/mongod --setParameter featureFlagSbeFull=true --setParameter featureFlagTimeSeriesInSbe=true --setParameter logComponentVerbosity='{query: 5}'
> db.coll.drop()
> db.createCollection("coll", {timeseries: {timeField: "t"}})
> db.coll.insert({t: new Date(), a: 4, b: 7, c: 5})
> db.coll.insert({t: new Date(), a: 2, b: 9, c: 8})
> db.coll.insert({t: new Date(), a: 3, b: 1, c: 6})
..

The goal of this task is to get the following queries working in block-processing mode:

> db.coll.aggregate([{$project: {a: 1}}, {$group: {_id: "$c", x: {$min : "$a"}}}])

> db.coll.aggregate([{$project: {a: 1}}, {$group: {_id: "$c", x: {$max : "$a"}}}])


Generated at Thu Feb 08 06:55:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.