[SERVER-77693] Can't specify non-default collation when aggregation contains unionWith/lookup to timeseries collection Created: 01/Jun/23  Updated: 02/Feb/24

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: 6.0.5
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kristin D Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-54597 Allow users to specify non-default co... Closed
Assigned Teams:
Query Integration
Operating System: ALL
Steps To Reproduce:

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'}});

 

Sprint: 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
Participants:

 Description   

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.



 Comments   
Comment by Chris Kelly [ 20/Jun/23 ]

Hi kristin.dorgelo@vertigis.com!

Thanks for your descriptive report! I'm going to pass this on to a relevant team to take a look.

Christopher

Generated at Thu Feb 08 06:36:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.