-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
QO 2021-12-13, QO 2021-12-27, QO 2022-01-10
Points to consider:
- Densify does not guarantee any sort order after the stage as of now. Doing this work would lock densify behavior
- This may cause issues when we want to implement categorical densification
- Densify sorts on {p1: 1, p2: 1, ..., densifyField: 1} in the non "full" case
- Densify sorts on {densifyField: 1} in the "full" case
- setWindowFields ($fill) sorts on {p1: 1, p2: 1, ..., sortBy: 1}
- Densify does not allow "complex" (non-field path expression) partitions
Therefore we can possibly combine the sorts in the following situations. Note that in all cases if the generated sorts on not the same, they will not be able to be combined.
- Partitions in $densify and $fill must be the same
- If there are partitions:
- Densify type must not be "full"
- $fill sortBy must be the densifyField
- If there is a user specified sort before the non-desuguared $densify, we can still optimize if the user sortKey maintains the required sort for $densify and matches the sortBy field.
- If there are no partitions:
- $fill sortBy must be the densifyField
- If there is a user specified sort before the non-desuguared $densify, we can still optimize if the user sortKey maintains the required sort for $densify and matches the sortBy field.
- $fill sortBy must be the densifyField
- depends on
-
SERVER-60502 Implement $fill parsing/desugaring
- Closed