[SERVER-82078] Handle empty window in SBE window with first/last removable accumulators set to Constant Expression Created: 11/Oct/23 Updated: 13/Nov/23 Resolved: 18/Oct/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 7.1.1 |
| Fix Version/s: | 7.2.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Foteini Alvanaki | Assignee: | Foteini Alvanaki |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v7.1
|
||||||||
| Sprint: | QE 2023-10-16, QE 2023-10-30 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 147 | ||||||||
| Description |
|
In SBE Window stage we track the first/last documents in a window in dedicated slots. We use these slots to compute the first/last accumulators. We use these slots to decide if the window is empty and what the result should be. When the expression assigned to first/last accumulator in the query is a constant we do not associate it with a slot. Thus, we do not have a way to say if the window is empty. In this case we return the constant expression even when the window is empty. This is not expected. The results when the window is empty should be null. |
| Comments |
| Comment by Githook User [ 18/Oct/23 ] | |||||||||||||||||||||||||||||
|
Author: {'name': 'Foteini Alvanaki', 'email': 'foteini.alvanaki@mongodb.com', 'username': ''}Message: | |||||||||||||||||||||||||||||
| Comment by Foteini Alvanaki [ 11/Oct/23 ] | |||||||||||||||||||||||||||||
|
I was able to reproduce this by running the following
Results in SBE
Results in Classic
|