[SERVER-60762] $setWindowFields partitionBy an array should consistently error Created: 15/Oct/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.1.0-rc3, 5.0.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Percy | Assignee: | David Percy |
| 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
|
||||||||
| Sprint: | QO 2021-11-01 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 175 | ||||||||
| Description |
|
$setWindowFields raises an error if the partitionBy expression ever evaluates to an array. (We added this restriction to allow $sort to handle most of the partitioning.) But during parsing, if the partitionBy expression optimizes to a constant, we remove it. (Partitioning by a constant is equivalent to not doing any partitioning.) We do this even if it's a constant array, which hides the error. This is misleading: we say partitionBy can't be an array, but then examples like 'partitionBy: [1, 2, 3]' don't raise an error. |
| Comments |
| Comment by Githook User [ 04/Nov/21 ] |
|
Author: {'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}Message: |
| Comment by Githook User [ 29/Oct/21 ] |
|
Author: {'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}Message: |
| Comment by Githook User [ 22/Oct/21 ] |
|
Author: {'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}Message: |