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

XMLWordPrintableJSON

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

      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
              Reporter:
              Mihai Andrei
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: