Go SDK N1QL prepared statement error

n1ql

#1

Hello! I’m trying to execute a prepared N1QL query using the Go SDK and many are working but one in particular consistently fails with this error:

{
  "code": 4070,
  "msg": "Unable to decode prepared statement - cause: Unrecognizable prepared statement - cause: unable to convert to prepared statment."
}

This happens with a development project, but I’ve been able to reproduce it with a contrived database structure. Here’s the client code:

package main

import (
  "fmt"
  "github.com/couchbase/gocb"
)

func main() {
  cluster, err := gocb.Connect("couchbase://localhost")
  if err != nil {
    panic(err)
  }

  bucket, err := cluster.OpenBucket("n1ql-test", "")
  if err != nil {
    panic(err)
  }

  query := gocb.NewN1qlQuery("select distinct field1 from `n1ql-test` where field2 in [\"value2\", \"value3\"] and field3 = $value").AdHoc(false)

  results, err := bucket.ExecuteN1qlQuery(query, map[string]interface{}{
    "value": "value3",
  })
  if err != nil {
    panic(err)
  }

  var row interface{}
  for results.Next(&row) {
    fmt.Println("row:", row)
  }
}

The HTTP exchanges are below.

Prepare statement:

POST /query/service HTTP/1.1
Host: localhost:8093
Authorization: Basic bjFxbC10ZXN0Og==
Content-Type: application/json

{"statement":"PREPARE select distinct field1 from `n1ql-test` where field2 in [\"value2\", \"value3\"] and field3 = $value"}

HTTP/1.1 200 OK
Content-Length: 9414
Content-Type: application/json; version=1.0.0
Date: Fri, 23 Oct 2015 14:16:41 GMT

{
    "requestID": "4decf33a-f207-4158-8f5e-b2bd64c16b3d",
    "signature": "json",
    "results": [
        {
            "encoded_plan": "H4sIAAAJbogA/7xTUW/aMBD+K9ZtDyCFCRICNNIeKq3VkPaAQHtqUTHxEdwah9pOy1ax374LAVKWtNKqqk9xzt/3+e67uydAHacCxc1acQ0RgAear5BO3flZr4dh3OLzQbvV7YeiNZ/3Fq12KILFPPR5GHYJna7RcJcaiJ7gU/kDE7zPSBsJ8ideSiUMkv7VKeg8c8vUyN85agd6k8pQOzQWYzeJqQYPLH1sBfVTy1S/ihhqgZs9QuZnii0kKhFQ4A5/2TWPc2d05161HFpHYSVX0kF05vtB0PfbQW8Qdvv9cNDuF0YeOAIXPFM5gyL7tyeIdxDpTCkPxlwnmFf/I32kS/j8wFWGMPXgu0yWp5GhjlVmqRqIgu3Wey8hCtCPTijbxErYTnPpd3LQ/3gHr2FXp38Nz4s/jf6Xk3tqUCsY1AlWHa14OuKGK4XqOOBv2oBLdPHyZYvrbPw3kUupaIvyPUy1kG5XAjQajdlRaPZlVvRy1mRSs6vSSo+VLkybjGvB6ogBEb+yYvyazUoGQ03PcjUy6S3tMmUipHVS0zFyJkMPDFrK/IbSXBXtx806J9Y81Zk1awb420GwWrwuHybey0TShLWRD1JhgjZv1t7QqDQ86lQEJs4gXxV0KxPNXWZ2s1VkS4hbS47TrcONy+difDE6H18wi4pyYgcrWIFnC5Ou2LOy2eMSDRa3/mvd2TWn6MaxF7D9GwAA//+WY5r7BwYAAA==",
            "name": "4b966e5c-ab80-475d-bb6f-05d3fb52a554",
            "operator": {
                "#operator": "Sequence",
                "~children": [
                    {
                        "#operator": "Authorize",
                        "child": {
                            "#operator": "Sequence",
                            "~children": [
                                {
                                    "#operator": "IntersectScan",
                                    "scans": [
                                        {
                                            "#operator": "UnionScan",
                                            "scans": [
                                                {
                                                    "#operator": "IndexScan",
                                                    "index": "field3",
                                                    "keyspace": "n1ql-test",
                                                    "limit": 9.223372036854776e+18,
                                                    "namespace": "default",
                                                    "spans": [
                                                        {
                                                            "Range": {
                                                                "High": [
                                                                    "$value"
                                                                ],
                                                                "Inclusion": 3,
                                                                "Low": [
                                                                    "$value"
                                                                ]
                                                            },
                                                            "Seek": null
                                                        },
                                                        {
                                                            "Range": {
                                                                "High": [
                                                                    "$value"
                                                                ],
                                                                "Inclusion": 3,
                                                                "Low": [
                                                                    "$value"
                                                                ]
                                                            },
                                                            "Seek": null
                                                        }
                                                    ],
                                                    "using": "gsi"
                                                }
                                            ]
                                        },
                                        {
                                            "#operator": "UnionScan",
                                            "scans": [
                                                {
                                                    "#operator": "IndexScan",
                                                    "index": "field2",
                                                    "keyspace": "n1ql-test",
                                                    "limit": 9.223372036854776e+18,
                                                    "namespace": "default",
                                                    "spans": [
                                                        {
                                                            "Range": {
                                                                "High": [
                                                                    "\"value2\""
                                                                ],
                                                                "Inclusion": 3,
                                                                "Low": [
                                                                    "\"value2\""
                                                                ]
                                                            },
                                                            "Seek": null
                                                        },
                                                        {
                                                            "Range": {
                                                                "High": [
                                                                    "\"value3\""
                                                                ],
                                                                "Inclusion": 3,
                                                                "Low": [
                                                                    "\"value3\""
                                                                ]
                                                            },
                                                            "Seek": null
                                                        }
                                                    ],
                                                    "using": "gsi"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "#operator": "Parallel",
                                    "~child": {
                                        "#operator": "Sequence",
                                        "~children": [
                                            {
                                                "#operator": "Fetch",
                                                "keyspace": "n1ql-test",
                                                "namespace": "default"
                                            },
                                            {
                                                "#operator": "Filter",
                                                "condition": "(((`n1ql-test`.`field2`) in [\"value2\", \"value3\"]) and ((`n1ql-test`.`field3`) = $value))"
                                            },
                                            {
                                                "#operator": "InitialProject",
                                                "distinct": true,
                                                "result_terms": [
                                                    {
                                                        "expr": "(`n1ql-test`.`field1`)"
                                                    }
                                                ]
                                            },
                                            {
                                                "#operator": "Distinct"
                                            },
                                            {
                                                "#operator": "FinalProject"
                                            }
                                        ]
                                    }
                                },
                                {
                                    "#operator": "Distinct"
                                }
                            ]
                        },
                        "privileges": {
                            "default:n1ql-test": 1
                        }
                    },
                    {
                        "#operator": "Stream"
                    }
                ]
            },
            "signature": {
                "field1": "json"
            },
            "text": "PREPARE select distinct field1 from `n1ql-test` where field2 in [\"value2\", \"value3\"] and field3 = $value"
        }
    ],
    "status": "success",
    "metrics": {
        "elapsedTime": "5.0003ms",
        "executionTime": "5.0003ms",
        "resultCount": 1,
        "resultSize": 9122
    }
}

Execute statement:

POST /query/service HTTP/1.1
Host: localhost:8093
Authorization: Basic bjFxbC10ZXN0Og==
Content-Type: application/json

{"$value":"value3","encoded_plan":"H4sIAAAJbogA/7xTUW/aMBD+K9ZtDyCFCRICNNIeKq3VkPaAQHtqUTHxEdwah9pOy1ax374LAVKWtNKqqk9xzt/3+e67uydAHacCxc1acQ0RgAear5BO3flZr4dh3OLzQbvV7YeiNZ/3Fq12KILFPPR5GHYJna7RcJcaiJ7gU/kDE7zPSBsJ8ideSiUMkv7VKeg8c8vUyN85agd6k8pQOzQWYzeJqQYPLH1sBfVTy1S/ihhqgZs9QuZnii0kKhFQ4A5/2TWPc2d05161HFpHYSVX0kF05vtB0PfbQW8Qdvv9cNDuF0YeOAIXPFM5gyL7tyeIdxDpTCkPxlwnmFf/I32kS/j8wFWGMPXgu0yWp5GhjlVmqRqIgu3Wey8hCtCPTijbxErYTnPpd3LQ/3gHr2FXp38Nz4s/jf6Xk3tqUCsY1AlWHa14OuKGK4XqOOBv2oBLdPHyZYvrbPw3kUupaIvyPUy1kG5XAjQajdlRaPZlVvRy1mRSs6vSSo+VLkybjGvB6ogBEb+yYvyazUoGQ03PcjUy6S3tMmUipHVS0zFyJkMPDFrK/IbSXBXtx806J9Y81Zk1awb420GwWrwuHybey0TShLWRD1JhgjZv1t7QqDQ86lQEJs4gXxV0KxPNXWZ2s1VkS4hbS47TrcONy+difDE6H18wi4pyYgcrWIFnC5Ou2LOy2eMSDRa3/mvd2TWn6MaxF7D9GwAA//+WY5r7BwYAAA==","prepared":"4b966e5c-ab80-475d-bb6f-05d3fb52a554","statement":"select distinct field1 from `n1ql-test` where field2 in [\"value2\", \"value3\"] and field3 = $value"}

HTTP/1.1 500 Internal Server Error
Content-Length: 458
Content-Type: application/json; version=1.0.0
Date: Fri, 23 Oct 2015 14:16:41 GMT

{
    "requestID": "5272c999-1927-45f4-9abc-56d06947a54a",
    "errors": [
        {
            "code": 4070,
            "msg": "Unable to decode prepared statement - cause: Unrecognizable prepared statement - cause: unable to convert to prepared statment."
        }
    ],
    "status": "fatal",
    "metrics": {
        "elapsedTime": "0",
        "executionTime": "0",
        "resultCount": 0,
        "resultSize": 0,
        "errorCount": 1
    }
}

I noticed in bucket_http.go that during preparation the statement key is delete from the request options but not during execution, so I tried adding the same delete statement to execution. Interestingly this works on subsequent execution requests, but not the initial execution request.

Any ideas?


#2

Hey @jdknezek,

What version of the Go SDK are you using, and coupled with what Couchbase Server version?

Cheers, Brett


#3

I’m using the master branch of the Go SDK and Couchbase Server version 4.0.0-4051 Enterprise Edition.

After further experimentation, I can get consistent success if I modify bucket_http.go to delete the "statement" key from the execution execOpts during execution (like during preparation), and don’t set the "encoded_plan" key on either request, so that "prepared" is the only non-query parameter (like in the N1QL REST API docs):

POST /query/service HTTP/1.1
Host: localhost:8093
Authorization: Basic bjFxbC10ZXN0Og==
Content-Type: application/json

{"$value":"value3","prepared":"b4404650-0c4c-480f-ba6d-207d66e38f51"}

HTTP/1.1 200 OK
Content-Length: 306
Content-Type: application/json; version=1.0.0
Date: Fri, 23 Oct 2015 18:03:12 GMT

{
    "requestID": "c0dea27b-c17b-48b9-b302-368461ee852f",
    "signature": {
        "field1": "json"
    },
    "results": [
    ],
    "status": "success",
    "metrics": {
        "elapsedTime": "3.0003ms",
        "executionTime": "2.0002ms",
        "resultCount": 0,
        "resultSize": 0
    }
}

Patch, for reference:

@@ -358,7 +358,6 @@ func (b *Bucket) ExecuteN1qlQuery(q *N1qlQuery, params interface{}) (ViewResults
    // Attempt to execute our cached query plan
    delete(execOpts, "statement")
    execOpts["prepared"] = cachedStmt.name
-   execOpts["encoded_plan"] = cachedStmt.encodedPlan

    results, err := b.executeN1qlQuery(n1qlEp, execOpts)
    if err == nil {
@@ -388,8 +387,8 @@ func (b *Bucket) ExecuteN1qlQuery(q *N1qlQuery, params interface{}) (ViewResults
  b.queryCacheLock.Unlock()

  // Update with new prepared data
+ delete(execOpts, "statement")
  execOpts["prepared"] = cachedStmt.name
- execOpts["encoded_plan"] = cachedStmt.encodedPlan

  return b.executeN1qlQuery(n1qlEp, execOpts)
}

#4

Apparently this workaround is only viable for a single-server cluster. As soon as there are multiple query servers, each one may or may not contain the prepared statement, so the "encoded_plan" key is supposed to be included for those that don’t already have it prepared (see MB-16183).

So this remains a problem, and appears to be fundamental to the query server, not necessarily the Go SDK…


#6

Hey @jdknezek,

The issue has been corrected, please see: https://issues.couchbase.com/browse/GOCBC-70.

Cheers, Brett


#7

I had tried that as an intermediate step before deleting "encoded_plan", but the original error still exists with just the "statement" change. It appears to have to do with the secondary indexes, as with just a #primary index the request succeeds, but with any secondary indexes I get the same failure as originally. Note the query plans below.

Success (only #primary index):

POST /query/service HTTP/1.1
Host: localhost:8093
Authorization: Basic bjFxbC10ZXN0Og==
Content-Type: application/json

{"statement":"PREPARE select field1 from `n1ql-test` where field2 in [\"value2\", \"value3\"] and field3 = $value"}

HTTP/1.1 200 OK
Content-Length: 3788
Content-Type: application/json; version=1.0.0
Date: Tue, 27 Oct 2015 18:47:35 GMT

{
    "requestID": "6cadc022-5fc9-4988-b0b9-01aed2c39253",
    "signature": "json",
    "results": [
        {
            "encoded_plan": "H4sIAAAJbogA/5xRwW7bMAz9FYHdIQHsYY7tZjOwQw8tsFvQHJuiFizaVidLriR36Yrs20fZWbKlxYD2Jj0+Pj4+PgPqyggUd73iGgqACDTvkF5JlqZLXPJYIGZxlvE0/nKeforTpEo+n+d5vcxzYpseLffGQvEMZ8cPrPFhIG0kyq+qlUpYJP2bf0kXg2+NlT8DayS9S2VlZcft07qiDSKQWuCW0LN+ggn6jk+u51XYSicPKvbo/H7RP7jAmg8qoIOTuiGkcRJ20ckkbrlSqA523uX3Cn3Vvs3WqZErqTzakJrRQnppwu1ms1l5ECo/lrVEJRblnEnNbjbwyNWAiw1EbP9ON3A7Z1wL9lpjSo1f2YeROZ+/cPBN01iuVtbcYxVsW3Tk9I5sdW5cGbd9IL4inZSkd/tyJ33Uo3JgAB3xUSps0IWo93EUx7iKZHeqs/YWeTcOACcbzf1gMXRPs4lx7ygvqnrc+nDV68vVxfUlc6hoNJtorLamY395Zz9atDhVF/+LdEx0ivAQIOx+BwAA//+0KolVagMAAA==",
            "name": "14337e7a-dee4-44a3-9630-31c18655f755",
            "operator": {
                "#operator": "Sequence",
                "~children": [
                    {
                        "#operator": "Authorize",
                        "child": {
                            "#operator": "Sequence",
                            "~children": [
                                {
                                    "#operator": "PrimaryScan",
                                    "index": "#primary",
                                    "keyspace": "n1ql-test",
                                    "namespace": "default",
                                    "using": "gsi"
                                },
                                {
                                    "#operator": "Parallel",
                                    "~child": {
                                        "#operator": "Sequence",
                                        "~children": [
                                            {
                                                "#operator": "Fetch",
                                                "keyspace": "n1ql-test",
                                                "namespace": "default"
                                            },
                                            {
                                                "#operator": "Filter",
                                                "condition": "(((`n1ql-test`.`field2`) in [\"value2\", \"value3\"]) and ((`n1ql-test`.`field3`) = $value))"
                                            },
                                            {
                                                "#operator": "InitialProject",
                                                "result_terms": [
                                                    {
                                                        "expr": "(`n1ql-test`.`field1`)"
                                                    }
                                                ]
                                            },
                                            {
                                                "#operator": "FinalProject"
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        "privileges": {
                            "default:n1ql-test": 1
                        }
                    },
                    {
                        "#operator": "Stream"
                    }
                ]
            },
            "signature": {
                "field1": "json"
            },
            "text": "PREPARE select field1 from `n1ql-test` where field2 in [\"value2\", \"value3\"] and field3 = $value"
        }
    ],
    "status": "success",
    "metrics": {
        "elapsedTime": "2.724363ms",
        "executionTime": "2.491545ms",
        "resultCount": 1,
        "resultSize": 3492
    }
}

POST /query/service HTTP/1.1
Host: localhost:8093
Authorization: Basic bjFxbC10ZXN0Og==
Content-Type: application/json

{"$value":"value3","encoded_plan":"H4sIAAAJbogA/5xRwW7bMAz9FYHdIQHsYY7tZjOwQw8tsFvQHJuiFizaVidLriR36Yrs20fZWbKlxYD2Jj0+Pj4+PgPqyggUd73iGgqACDTvkF5JlqZLXPJYIGZxlvE0/nKeforTpEo+n+d5vcxzYpseLffGQvEMZ8cPrPFhIG0kyq+qlUpYJP2bf0kXg2+NlT8DayS9S2VlZcft07qiDSKQWuCW0LN+ggn6jk+u51XYSicPKvbo/H7RP7jAmg8qoIOTuiGkcRJ20ckkbrlSqA523uX3Cn3Vvs3WqZErqTzakJrRQnppwu1ms1l5ECo/lrVEJRblnEnNbjbwyNWAiw1EbP9ON3A7Z1wL9lpjSo1f2YeROZ+/cPBN01iuVtbcYxVsW3Tk9I5sdW5cGbd9IL4inZSkd/tyJ33Uo3JgAB3xUSps0IWo93EUx7iKZHeqs/YWeTcOACcbzf1gMXRPs4lx7ygvqnrc+nDV68vVxfUlc6hoNJtorLamY395Zz9atDhVF/+LdEx0ivAQIOx+BwAA//+0KolVagMAAA==","prepared":"14337e7a-dee4-44a3-9630-31c18655f755"}

HTTP/1.1 200 OK
Content-Length: 311
Content-Type: application/json; version=1.0.0
Date: Tue, 27 Oct 2015 18:47:35 GMT

{
    "requestID": "8bee71cb-7a83-4c6d-8940-5675ca3b9c71",
    "signature": {
        "field1": "json"
    },
    "results": [
    ],
    "status": "success",
    "metrics": {
        "elapsedTime": "25.70515ms",
        "executionTime": "25.592915ms",
        "resultCount": 0,
        "resultSize": 0
    }
}

Failure (using secondary indexes):

POST /query/service HTTP/1.1
Host: localhost:8093
Authorization: Basic bjFxbC10ZXN0Og==
Content-Type: application/json

{"statement":"PREPARE select distinct field1 from `n1ql-test` where field2 in [\"value2\", \"value3\"] and field3 = $value"}

HTTP/1.1 200 OK
Content-Length: 9420
Content-Type: application/json; version=1.0.0
Date: Tue, 27 Oct 2015 18:32:43 GMT

{
    "requestID": "027cd6a8-c659-459f-a460-a9f5f6a377a1",
    "signature": "json",
    "results": [
        {
            "encoded_plan": "H4sIAAAJbogA/7xTQW/bPAz9KwK/75AAzhDbdd0Y2KHAWizADkGCndqgEWzaUavIqSS32Yrst4+Kk7ib3aIrhp0sU49PfI/kE6BKywyzm7XkChIADxRfIZ2iURBGQz8e+NyPBidxPhrwEINBhjw6Heb5MMpTQpdr1NyWGpIn+K/5gRneV8SNBPmRLoXMNBL/1a+g88ouSy2+O9QO9C6WsbKoDaZ2lpIGDwx9TAv1VYlSvYoYqww3e4RwZ4rlAmUWUOAOv5k1T50zyr+XA4vGUliKlbCQjIIgDONgGJ6eRSdxHJ0N49rIQ06GOa+ky6DI/u0Z4h0kqpLSgylXBTr1X8pHuoRreOCywuAaYO7BZ1Es29GxSmVlSBUk4XbrvYkw7CQMuwgpQD+qoOoLI2A7d0/8JUfDf+/o/zulz8U3kT9y8u1EbQdbHk645lKiPA74uzbgEm26fNnSLtt+L+RSSNoit4elyoTdSYBer7c4Ei0+LOptWPSZUOyqGUaPNXM07zOuMtaVGFLiR1ab1e+3KhgrepbLiS5vaZepkkwYKxQdE6sr9ECjocpvqMxV3W7crF1ix1P+ot8xsJ8OhG3xqnmY8l5OJE5Ya/EgJBZoXLP2hiaN4YnfIphZjXxVpxtRKG4rvZupulpC3BpynG4tbqybi+nF5Hx6wQxKqokdrGA1nuW6XLFnstnjEjXWt8Fr3dk1p+7GsRew/RkAAP//hgHmNAcGAAA=",
            "name": "59235017-1a15-47f9-a3e2-dea560ff05fc",
            "operator": {
                "#operator": "Sequence",
                "~children": [
                    {
                        "#operator": "Authorize",
                        "child": {
                            "#operator": "Sequence",
                            "~children": [
                                {
                                    "#operator": "IntersectScan",
                                    "scans": [
                                        {
                                            "#operator": "UnionScan",
                                            "scans": [
                                                {
                                                    "#operator": "IndexScan",
                                                    "index": "field2",
                                                    "keyspace": "n1ql-test",
                                                    "limit": 9.223372036854776e+18,
                                                    "namespace": "default",
                                                    "spans": [
                                                        {
                                                            "Range": {
                                                                "High": [
                                                                    "\"value2\""
                                                                ],
                                                                "Inclusion": 3,
                                                                "Low": [
                                                                    "\"value2\""
                                                                ]
                                                            },
                                                            "Seek": null
                                                        },
                                                        {
                                                            "Range": {
                                                                "High": [
                                                                    "\"value3\""
                                                                ],
                                                                "Inclusion": 3,
                                                                "Low": [
                                                                    "\"value3\""
                                                                ]
                                                            },
                                                            "Seek": null
                                                        }
                                                    ],
                                                    "using": "gsi"
                                                }
                                            ]
                                        },
                                        {
                                            "#operator": "UnionScan",
                                            "scans": [
                                                {
                                                    "#operator": "IndexScan",
                                                    "index": "field3",
                                                    "keyspace": "n1ql-test",
                                                    "limit": 9.223372036854776e+18,
                                                    "namespace": "default",
                                                    "spans": [
                                                        {
                                                            "Range": {
                                                                "High": [
                                                                    "$value"
                                                                ],
                                                                "Inclusion": 3,
                                                                "Low": [
                                                                    "$value"
                                                                ]
                                                            },
                                                            "Seek": null
                                                        },
                                                        {
                                                            "Range": {
                                                                "High": [
                                                                    "$value"
                                                                ],
                                                                "Inclusion": 3,
                                                                "Low": [
                                                                    "$value"
                                                                ]
                                                            },
                                                            "Seek": null
                                                        }
                                                    ],
                                                    "using": "gsi"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "#operator": "Parallel",
                                    "~child": {
                                        "#operator": "Sequence",
                                        "~children": [
                                            {
                                                "#operator": "Fetch",
                                                "keyspace": "n1ql-test",
                                                "namespace": "default"
                                            },
                                            {
                                                "#operator": "Filter",
                                                "condition": "(((`n1ql-test`.`field2`) in [\"value2\", \"value3\"]) and ((`n1ql-test`.`field3`) = $value))"
                                            },
                                            {
                                                "#operator": "InitialProject",
                                                "distinct": true,
                                                "result_terms": [
                                                    {
                                                        "expr": "(`n1ql-test`.`field1`)"
                                                    }
                                                ]
                                            },
                                            {
                                                "#operator": "Distinct"
                                            },
                                            {
                                                "#operator": "FinalProject"
                                            }
                                        ]
                                    }
                                },
                                {
                                    "#operator": "Distinct"
                                }
                            ]
                        },
                        "privileges": {
                            "default:n1ql-test": 1
                        }
                    },
                    {
                        "#operator": "Stream"
                    }
                ]
            },
            "signature": {
                "field1": "json"
            },
            "text": "PREPARE select distinct field1 from `n1ql-test` where field2 in [\"value2\", \"value3\"] and field3 = $value"
        }
    ],
    "status": "success",
    "metrics": {
        "elapsedTime": "10.901374ms",
        "executionTime": "10.825543ms",
        "resultCount": 1,
        "resultSize": 9122
    }
}

POST /query/service HTTP/1.1
Host: localhost:8093
Authorization: Basic bjFxbC10ZXN0Og==
Content-Type: application/json

{"$value":"value3","encoded_plan":"H4sIAAAJbogA/7xTQW/bPAz9KwK/75AAzhDbdd0Y2KHAWizADkGCndqgEWzaUavIqSS32Yrst4+Kk7ib3aIrhp0sU49PfI/kE6BKywyzm7XkChIADxRfIZ2iURBGQz8e+NyPBidxPhrwEINBhjw6Heb5MMpTQpdr1NyWGpIn+K/5gRneV8SNBPmRLoXMNBL/1a+g88ouSy2+O9QO9C6WsbKoDaZ2lpIGDwx9TAv1VYlSvYoYqww3e4RwZ4rlAmUWUOAOv5k1T50zyr+XA4vGUliKlbCQjIIgDONgGJ6eRSdxHJ0N49rIQ06GOa+ky6DI/u0Z4h0kqpLSgylXBTr1X8pHuoRreOCywuAaYO7BZ1Es29GxSmVlSBUk4XbrvYkw7CQMuwgpQD+qoOoLI2A7d0/8JUfDf+/o/zulz8U3kT9y8u1EbQdbHk645lKiPA74uzbgEm26fNnSLtt+L+RSSNoit4elyoTdSYBer7c4Ei0+LOptWPSZUOyqGUaPNXM07zOuMtaVGFLiR1ab1e+3KhgrepbLiS5vaZepkkwYKxQdE6sr9ECjocpvqMxV3W7crF1ix1P+ot8xsJ8OhG3xqnmY8l5OJE5Ya/EgJBZoXLP2hiaN4YnfIphZjXxVpxtRKG4rvZupulpC3BpynG4tbqybi+nF5Hx6wQxKqokdrGA1nuW6XLFnstnjEjXWt8Fr3dk1p+7GsRew/RkAAP//hgHmNAcGAAA=","prepared":"59235017-1a15-47f9-a3e2-dea560ff05fc"}

HTTP/1.1 500 Internal Server Error
Content-Length: 474
Content-Type: application/json; version=1.0.0
Date: Tue, 27 Oct 2015 18:32:43 GMT

{
    "requestID": "e9beb817-ec7c-4617-a8bd-04d0bff377e9",
    "errors": [
        {
            "code": 4070,
            "msg": "Unable to decode prepared statement - cause: Unrecognizable prepared statement - cause: unable to convert to prepared statment."
        }
    ],
    "status": "fatal",
    "metrics": {
        "elapsedTime": "113.36µs",
        "executionTime": "88.389µs",
        "resultCount": 0,
        "resultSize": 0,
        "errorCount": 1
    }
}