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

Support limit expression for $filter in SBE

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Query Execution
    • None
    • Query Execution

    Description

      This invariant is firing in the visit overload for ExpressionFilter during translation of a $filter during work in SERVER-32739.

      https://github.com/10gen/mongo/blob/master/src/mongo/db/query/sbe_stage_builder_expression.cpp#L522

      A possible explanation for this is that the expression walker will make the following calls since $filter has multiple children,

      preVisit(), inVisit(), inVisit(), postVisit.

      On the first inVisit() call we pull the variableId from the ExpressionFilter instance that we are translating, and stick it in _context->environment. Then on the second inVisit call we pull the same variableId from the ExpressionFilter instance and since we have already inserted the variableId into the environment, we trip the invariant.

      This work should support translation of a limit expression in $filter.

      Attachments

        Activity

          People

            backlog-query-execution Backlog - Query Execution
            eric.cox@mongodb.com Eric Cox (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: