[SERVER-83620] DISTINCT_SCAN produces incorrect results for nested arrays Created: 28/Nov/23  Updated: 28/Nov/23

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

Type: Improvement Priority: Major - P3
Reporter: Irina Yatsenko (Inactive) Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Integration
Participants:

 Description   

db.u.drop()
db.u.insert({"a" : [ [ 1, 2 ], 3 ]})
 
db.u.distinct("a")
// result: [ 3, [ 1, 2 ] ]
 
db.u.createIndex({a: 1})
db.u.distinct("a")
// result: [ 1, 2, 3 ] -- the nested array [1, 2] got unwound but it shouldn't
// the plan here is PROJECTION_COVERED over DISTINCT_SCAN


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