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

Inside array missing values converted to string

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • bug-backlog
    • 5.1.0, 5.5.0
    • secondary-index
    • None
    • Untriaged
    • Unknown

    Description

      insert into default values ("k01",{"a":5, "b":null});
      create index ix1 on default(a,[a,b,c]);
      select a, [a,b,c] from default where a = 5;
      

      Above query is covered.

      select a, [a,b,c] from default where a = 5;
      {
          "requestID": "cb21d244-8e31-435a-9425-1778a26b0f55",
          "signature": {
              "$1": "array",
              "a": "json"
          },
          "results": [
              {
                  "$1": [
                      5,
                      null,
                      "~[]{}falsenilNA~"
                  ],
                  "a": 5
              }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "1.541289ms",
              "executionTime": "1.519247ms",
              "resultCount": 1,
              "resultSize": 141
          }
      }
      

      If look the output 3rd element of array is given as string of missing value
      That is in correct. It can't convert to string. As MISSING can't be displayed inside array because no such thing in JSON and can't skip element and add another element array. N1QL keeps it as MISSING type and while sending to user or display time converts that to NULL. Indexer should send to as MISSING type not a string type.

      N1QL USE KEYS

      select a, [a,b,c] from default USE KEYS ["k01"] where a = 5 ;
      {
          "requestID": "17dfe29f-8ab1-441d-93d5-4710facf3b6a",
          "signature": {
              "$1": "array",
              "a": "json"
          },
          "results": [
              {
                  "$1": [
                      5,
                      null,
                      null
                  ],
                  "a": 5
              }
          ],
          "status": "success",
          "metrics": {
              "elapsedTime": "1.565704ms",
              "executionTime": "1.543396ms",
              "resultCount": 1,
              "resultSize": 127
          }
      }
      

      Attachments

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

        Activity

          People

            amit.kulkarni Amit Kulkarni
            Sitaram.Vemulapalli Sitaram Vemulapalli
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty