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

$setWindowFields partitionBy an array should consistently error

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 5.2.0, 5.1.0-rc3, 5.0.5
    • None
    • None
    • Minor Change
    • ALL
    • v5.1, v5.0
    • QO 2021-11-01
    • 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.

      Attachments

        Activity

          People

            david.percy@mongodb.com David Percy
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: