[SERVER-59303] Support limit expression for $filter in SBE Created: 11/Aug/21 Updated: 06/Dec/22 Resolved: 18/Aug/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Query Execution |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Eric Cox (Inactive) | Assignee: | Backlog - Query Execution |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Execution
|
||||||||
| Participants: | |||||||||
| Description |
|
This invariant is firing in the visit overload for ExpressionFilter during translation of a $filter during work in 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. |
| Comments |
| Comment by Eric Cox (Inactive) [ 18/Aug/21 ] |
|
anton.korshunov Closing as a duplicate and can do the work in |
| Comment by Anton Korshunov [ 16/Aug/21 ] |
|
eric.cox Yeah, it wasn't obvious from the description that the $filter expression has been changed by adding a new argument. I agree that this ticket is not a bug and a fix should be part of |
| Comment by Eric Cox (Inactive) [ 12/Aug/21 ] |
|
anton.korshunov I should have been more clear in the description. The changes in |