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

Refactor run_aggregate with a AggregationPlan class

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Integration

      run_aggregate.cpp provides the high-level runAggregate functionality, which delegates to a handful of helper functions. As we've been slowly splitting the file into more helper functions, the throughline of the main run_aggregate path has become clearer and more intelligible to engineers; however, each helper function has a list of up to 13 parameters.

      We recently added a ParsedFindCommand struct that tracks the metadata of a find command. We should add a AggregationPlan class that wraps the aggregate request, BSON cmdObj, lite parsed pipeline, requestedNss, and executionNss. Those are the primary elements of the run aggregate path that are used through each stage of the file, so this structure will (1) more clearly differentiate which variables are central through the entire process of aggregation versus one step along the way and (2) reduce the friction necessary to delegate runAggregate into more helper functions.

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            will.buerger@mongodb.com Will Buerger
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: