Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-84490

[BP] Support group-by $top/$bottom with multiple buckets

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution

      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, b: 1}}, {$group: {_id: "$c", x: {$top: {output: ["$a","$b"], sortBy: {b: 1}}}}}])
      
      > db.coll.aggregate([{$project: {a: 1, b: 1}}, {$group: {_id: "$c", x: {$bottom: {output: ["$a","$b"], sortBy: {b: 1}}}}}])

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            andrew.paroski@mongodb.com Drew Paroski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: