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

Comparisons made by $bucket at parse time must respect the collation

    • Fully Compatible
    • Query 18 (08/05/16), Query 2016-08-29, Query 2016-09-19, Query 2016-10-10
    • 0

      The difficulty is that parsing of the aggregation pipeline is done before lock acquisition, but the final collation is not always known until after the collection lock has been acquired (since we may need to read the collection's metadata describing the collection default collation). max.hirschhorn and myself brainstormed a few potential solutions:

      1. Parse the aggregation pipeline under the lock so we know what the collation is.
      2. Remove the comparisons and let users create buckets that will always be empty.
      3. Configure the $group stage to do the checks that require collation by making it aware that it's a $group for bucketing.
      4. Create a DocumentSourceBucket class that during its optimize() method does these checks, adds a DocumentSourceGroup and DocumentSourceSort to the pipeline, and then removes itself from the pipeline.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: