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

DISTINCT_SCAN produces incorrect results for nested arrays

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Integration

      Unable to find source-code formatter for language: javascript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      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
      

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            irina.yatsenko@mongodb.com Irina Yatsenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: