Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-94694

Allow 'n' expressions in window functions to reference partition key in $setWindowFields

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration

      At the time of writing, having a non constant expression for 'n' in window functions is not supported. This ticket proposes allowing the  'n' expression to reference the partition key (such that a given partition has a 'stable' value of 'n'), similar to how these expressions in $group can reference the group key.

      Other alternatives:

      • The 'n' expressions must be constants (and cannot reference any incoming document or the partition key), that is, keep the behavior which exists on classic at the time of writing.
      • The 'n' expression can reference the values from incoming documents. Note that this is not well defined without a sort, as there is no guarantee around the order in which documents will be seen in DocumentSourceInternalSetWindowFields::doGetNext()

            Assignee:
            Unassigned Unassigned
            Reporter:
            mihai.andrei@mongodb.com Mihai Andrei
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: