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

[CQF] Always translate projections to ABT using ProjectionExecutor

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • QO 2022-10-03, QE 2022-10-17

      This is an extension and continuation of SERVER-66846. The previous approach used a projection_executor, which we do not want to use in translating $project queries. SERVER-66846 only covers translating simple inclusion and exclusion projections from ProjectionAST. 

      This ticket was originally intended to change all the projection translation code to use the ProjectionAST. However, while implementing that, we discovered that ProjectionAST has no way to represent $addFields and $replaceRoot projections, which already had test-only support in CQF via the ProjectionExecutor codepath. While ideally we use parse trees as input to ABT translation instead of runtime data structures, in this case we chose to be more pragmatic and exercise more of the optimizer's code sooner. In the future, the current ABT translation will be replaced with a proper BSON > CST {} > ABT translation; hence, we don't get much value out of moving to the ProjectionAST right now. As a result, we chose to repurpose this ticket to undo the changes in SERVER-66846 (with updates, as the revert is not clean).

            Assignee:
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Reporter:
            emily.wang@mongodb.com Emily Wang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: