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

Can't specify non-default collation when aggregation contains unionWith/lookup to timeseries collection

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 6.0.5
    • Component/s: None
    • None
    • Query Integration
    • ALL
    • Hide

      Create collections. 

       

      db.createCollection('ts', {timeseries: {timeField: 'ts', metaField: 'meta'}});
      db.createCollection('test'); 

       

      This command succeeds after bug SERVER-54597 was fixed.

       

      db.ts.aggregate([{$project: {'meta.field1': 1}}], {collation: {locale: 'en'}});

       

      This command succeeds as the collation is the same as the timeseries collation. 

      db.test.aggregate([{$unionWith: {coll: 'ts', pipeline: [{$project: {'meta.field1': 1}}]}}], {collation: {locale: 'simple'}});

       

      This command throws an error as the collation is different than the timeseries collation. 

      db.test.aggregate([{$unionWith: {coll: 'ts', pipeline: [{$project: {'meta.field1': 1}}]}}], {collation: {locale: 'en'}});

       

      Show
      Create collections.    db.createCollection( 'ts' , {timeseries: {timeField: 'ts' , metaField: 'meta' }}); db.createCollection( 'test' );   This command succeeds after bug SERVER-54597 was fixed.   db.ts.aggregate([{$project: { 'meta.field1' : 1}}], {collation: {locale: 'en' }});   This command succeeds as the collation is the same as the timeseries collation.  db.test.aggregate([{$unionWith: {coll: 'ts' , pipeline: [{$project: { 'meta.field1' : 1}}]}}], {collation: {locale: 'simple' }});   This command throws an error as the collation is different than the timeseries collation.  db.test.aggregate([{$unionWith: {coll: 'ts' , pipeline: [{$project: { 'meta.field1' : 1}}]}}], {collation: {locale: 'en' }});  
    • QI 2023-07-10, QI 2023-07-24, QI 2023-08-07, QI 2023-08-21, QI 2023-09-04, QI 2023-09-18, QI 2023-10-02, QI 2023-10-16, QI 2023-10-30, QI 2023-11-13, QI 2023-11-27, QI 2023-12-11, QI 2023-12-25, QI 2024-01-08, QI 2024-01-22, QI 2024-02-05, QI 2024-02-19, QI 2024-03-04, QI 2024-03-18, QI 2024-04-01, QI 2024-04-15, QI 2024-04-29, QI 2024-05-13, QI 2024-05-27, QI 2024-06-10, QI 2024-06-24, QI 2024-07-08, QI 2024-07-22, QI 2024-08-05, QI 2024-08-19, QI 2024-09-02, QI 2024-09-16, QI 2024-09-30, QI 2024-10-14

      When running an aggregation pipeline that includes a $unionWith or $lookup stage to a timeseries collection, specifying a collation that is different than the timeseries collection's collation causes an error to be thrown: 

       

      MongoServerError: Cannot override a view's default collation

       

      If the collation of the timeseries collection and the specified collation of the aggregation are the same, then the aggregation succeeds. 

      There was a similar issue where performing an aggregation on a timeseries collection and specifying a non-default collation caused the same error to be thrown, but that was fixed: https://jira.mongodb.org/browse/SERVER-54597. The issue of specifying a non-default collation when a unionWith/lookup stage to a timeseries collection is involved still remains.

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            kristin.dorgelo@vertigis.com Kristin D
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: