Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-38287

non leading array index MISSING can give wrong results

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Morpheus
    • 6.5.1
    • query
    • None
    • Untriaged
    • Unknown

    Description

      insert into default (key, value) values("k01", { "c1": "a", "arr1": [ {"id":1}, {"x":2}, {"id":1}, {"id":4} ] });
      create index ix2 ON default(c1, ALL ARRAY v.id FOR v IN arr1 END);
      SELECT * FROM default WHERE c1 = "a" AND ANY v IN arr1 SATISFIES v.id IS MISSING END;
       
                              "spans": [
                                  {
                                      "exact": true,
                                      "range": [
                                          {
                                              "high": "\"a\"",
                                              "inclusion": 3,
                                              "low": "\"a\""
                                          },
                                          {
                                              "high": "null",
                                              "inclusion": 0
                                          }
                                      ]
                                  }
                              ]
      

      Above query generates MISSING span. This works correctly on scalar but not on array index key. Array Index key doesn't store MISSING values each array.
      This gives 0 results but primary index gives 1 result.

      Array Index key indexes MISSNG.

      • when whole array is empty
      • when individual element is MISSING it ignores unless all elements are MISSING then result in empty array

      Don't know what is right behavior. Either fix the array indexing or do missing span?

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ajay.bhullar Ajay Bhullar
              Sitaram.Vemulapalli Sitaram Vemulapalli
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty