-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
200
BF-34809 is caused due to different field order between the classic and bp timeseries runs for the following pipeline:
[{"$match": {"obj.obj.str": {"$lte": "structure"}}}, {"$project": {"obj.obj.obj.obj.obj": 1, "obj.obj.date": new Date('0001-01-01')}}, {"$addFields": {"obj.obj.obj.str": {"$toUpper": "Operative info-mediaries"}}}, { "$setWindowFields" : {"sortBy" : { "obj" : 1 }, "output" : { "obj.obj.obj.obj.obj" : { "$last" : { "$mergeObjects" : [ "$obj", { "k" : "Toys", "v" : false }]}}}}}]
With these documents:
const documentList = [
{_id: 77, time: new Date("2024-01-11T08:29:54.606Z"), "obj": {_id: 78, "obj": {_id: 79, "str": "Georgia Multi-layered Upgradable", "obj": {}} } }
{_id: 98, time: new Date("2024-01-11T18:58:58.948Z"), "tag": {scientist: 0, assistant: 1, }, "obj": {_id: 99, "str": "New Leu Small Concrete Car", "obj": {_id: 100, "str": "Forint violet calculate"}}}
{_id: 128, time: new Date("2024-01-12T22:28:03.624Z"), "tag": {scientist: 2, assistant: 0, }, "obj": {_id: 132, "str": "Incredible Soft Pants Alaska Tasty", "obj": {_id: 133, "str": "Car pixel", "date": null, "obj": {_id: 134, "str": "quantify Direct", "obj": {_id: 135, "str": null}}}}}
After the $addFields, the doc with _id: 98 differs in field order when running with classic vs sbe / bp:
{"_id":98,"obj":{"obj":{"date":"0001-01-01T00:00:00.000Z","obj":{"str":"OPERATIVE INFO-MEDIARIES"}}}}
{"_id":98,"obj":{"obj":{"obj":{"str":"OPERATIVE INFO-MEDIARIES"},"date":"0001-01-01T00:00:00.000Z"}}}
We should investigate this difference and the root cause and decide whether it is something we want to change / fix.
Attached is a document with the sbe explain output and simplified fuzzer test ExplainAndTest.txt