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

Is it possible to query binary data via select n1ql

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.0.0
    • 4.0.0
    • query
    • Security Level: Public
    • None
    • 350-1335
      centos6
    • Untriaged
    • Unknown

    Description

      1. create default bucket
      2. load data using cbworkloadgen
      ./cbworkloadgen -n 10.6.2.222:8091 -b default -t 10 -s 100 -i 1000000 -r 0.9

      3, select *
      cbq> select * from default;
      {
      "requestID": "8e484864-6aba-4ecf-aa2d-b79c15e8812d",
      "signature":

      { "*": "*" }

      ,
      "results": [

      ],
      "errors": [

      { "code": 1100, "msg": "Invalid JSON in results - cause: json: error calling MarshalJSON for type *value.annotatedValue: json: error calling MarshalJSON for type *value.ScopeValue: json: error calling MarshalJSON for type *value.annotatedValue: json: error calling MarshalJSON for type *value.parsedValue: Marshaling binary value returns raw bytes: VTKGNKUHMPXNHTQGXZVXISXRMCLPXZMWGUOASKVRAMWGIWEOGZULCINYCOSOVOZPPLPKOHEEPRMCTWYVXYOKSHVWXPYPLRZXUCPM" }

      ],
      "status": "fatal",
      "metrics":

      { "elapsedTime": "244.117499ms", "executionTime": "243.472683ms", "resultCount": 0, "resultSize": 0, "errorCount": 1 }

      }

      4. select raw.*

      cbq> select raw default.* from default LIMIT 1;
      {
      "requestID": "b64eb2c7-da02-419d-8b37-6f82cc5b514f",
      "errors": [

      { "code": 3000, "msg": "syntax error" }

      ],
      "status": "fatal",
      "metrics":

      { "elapsedTime": "1.073196ms", "executionTime": "930.114us", "resultCount": 0, "resultSize": 0, "errorCount": 1 }

      }

      5. encode_json

      cbq> select encode_json(`default`.*) from default LIMIT 1;
      {
      "requestID": "19906467-de3e-4977-aa6b-18eec51af09d",
      "errors": [

      { "code": 3000, "msg": "syntax error" }

      ],
      "status": "fatal",
      "metrics":

      { "elapsedTime": "1.1404ms", "executionTime": "990.014us", "resultCount": 0, "resultSize": 0, "errorCount": 1 }

      }

      cbq> select encode_json(default) from default LIMIT 1;
      {
      "requestID": "942a11d4-3112-4563-abc6-4df8802b2870",
      "signature":

      { "$1": "string" }

      ,
      "results": [

      { "$1": "" }

      ],
      "status": "success",
      "metrics":

      { "elapsedTime": "232.674614ms", "executionTime": "232.508223ms", "resultCount": 1, "resultSize": 32 }

      }

      i.e. I am trying to output binary data, and I am not able to do so via raw or encode_json.

      The doc looks like this
      pymc0 "VlRLR05LVUhNUFhOSENMUFhaTVdZT0tTSFZXWFBZUExSWlhVSVZDRFNCT1hOUkFRUE9LS

      Attached logs.

      Attachments

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

        Activity

          People

            gerald Gerald Sangudi (Inactive)
            ketaki Ketaki Gangal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty