[SERVER-59159] $min/max window function null semantics are different than their accumulator counterparts Created: 06/Aug/21 Updated: 29/Oct/23 Resolved: 22/Oct/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.2.0, 5.0.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Nicholas Zolnierz | Assignee: | Mihai Andrei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
|||||||||||||||
| Backwards Compatibility: | Minor Change | |||||||||||||||
| Operating System: | ALL | |||||||||||||||
| Backport Requested: |
v5.1, v5.0
|
|||||||||||||||
| Steps To Reproduce: |
|
|||||||||||||||
| Sprint: | QE 2021-11-01 | |||||||||||||||
| Participants: | ||||||||||||||||
| Description |
|
The $min/max accumulators specifically throw out nullish values, whereas they are kept in a multiset for window functions. The behavior may end up being correct for $max since nulls will generally sort before other types, but for $min we will always return null. |
| Comments |
| Comment by Githook User [ 28/Oct/21 ] |
|
Author: {'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}Message: |
| Comment by Githook User [ 27/Oct/21 ] |
|
Author: {'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}Message: (cherry picked from commit ba83473ade3ee39cd9053ed3b2b3bf3e5f64ba28) |
| Comment by Kyle Suarez [ 22/Oct/21 ] |
|
Thanks for verifying! |
| Comment by Mihai Andrei [ 22/Oct/21 ] |
|
I don't think the documentation needs changing; the page for $min already describes the behavior that this patch implements. |
| Comment by Kyle Suarez [ 22/Oct/21 ] |
|
mihai.andrei, should we documentation changes as "Needed"? |
| Comment by Githook User [ 21/Oct/21 ] |
|
Author: {'name': 'Mihai Andrei', 'email': 'mihai.andrei@10gen.com', 'username': 'mtandrei'}Message: |
| Comment by Nicholas Zolnierz [ 06/Aug/21 ] |