-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Integration
-
ALL
-
0
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In https://jira.mongodb.org/browse/BF-44202 , a pipeline on a timeseries collection containing $unionWith was found to error out during explain execution.
The example query is:
const aggregationList = [ [{"$sort": {"_id": 1}}, {"$bucket": {"groupBy": {"$rtrim": {"input": {"$toLower": "with royal petticoat"}, "chars": {"$toLower": "bug"}}}, "boundaries": ["excluding institute daddy", "yippee", "zesty"], "default": 71204, "output": {"obj": {"$first": {"$dateToParts": {"date": new Date("2019-07-16T12:00:40.434Z"), "timezone": "Australia/Lord_Howe"}}}, "array": {"$maxN": {"n": 12, "input": {"$setDifference": [[true, "$count"], ["$_id", "$obj.obj.obj.date"]]}}}}}}, {"$sort": {"_id": 1}}, {"$limit": 10}, {"$unionWith": {"coll": "fuzzer_coll", "pipeline": [{"$sort": {"_id": 1}}, {"$sortByCount": "$_id"}]}}], // 150];
The fuzzer tries to run this query via explain, because the results diverge between optimized/non-optimized. This divergence is caused by one plan choosing to execute via SBE vs. classic. It is a known divergence, but it is not caught because the explain query fails to execute in either engine.
The error we see is :
"error":"Location7158200: $toUpper input type is not supported
Currently, when serialize $unionWith in allPlansExecution, we use the _userPipeline which would not reflect the view resolution. This means that when we run explain for the pipeline, the buckets unpacking does not happen.
- duplicates
-
SERVER-98380 Explain with executionStats broken for $unionWith on Views
-
- Closed
-