Description
Have this error coming from sdk:
{ [Error: Unable to decode prepared statement - cause: Unrecognizable prepared statement - cause: JSON unmarshalling error: No operator for name DistinctScan]
I created the index with DISTINCT method in expression.
CREATE INDEX build_ver on `server`(`build`, DISTINCT SPLIT(`build`,\'-\')[0] );
Then query with:
select DISTINCT SPLIT(`build`,'-')[0] from `server` where `build` IS NOT NULL;
This goes ok with cbq, but sdk throws error seen above. From explain:
|
"requestID": "ba2f7e01-2542-48c2-a688-570b45a9f921",
|
"signature": "json",
|
"results": [
|
{
|
"plan": {
|
"#operator": "Sequence",
|
"~children": [
|
{
|
"#operator": "Sequence",
|
"~children": [
|
{
|
"#operator": "DistinctScan",
|
"scan": {
|
"#operator": "IndexScan",
|
"covers": [
|
"cover ((`server`.`build`))",
|
"cover ((distinct ((split((`server`.`build`), \"\")[0]))))",
|
"cover ((meta(`server`).`id`))"
|
],
|
"index": "build_verions",
|
"index_id": "8d28a330b0448436",
|
"keyspace": "server",
|
"namespace": "default",
|
"spans": [
|
{
|
"Range": {
|
"Inclusion": 0,
|
"Low": [
|
"null"
|
]
|
}
|
}
|
],
|
"using": "gsi"
|
}
|
},
|
{
|
"#operator": "Parallel",
|
"~child": {
|
"#operator": "Sequence",
|
"~children": [
|
{
|
"#operator": "Filter",
|
"condition": "(cover ((`server`.`build`)) is not null)"
|
},
|
{
|
"#operator": "InitialProject",
|
"distinct": true,
|
"result_terms": [
|
{
|
"as": "version",
|
"expr": "(split(cover ((`server`.`build`)), \"-\")[0])"
|
}
|
]
|
},
|
{
|
"#operator": "Distinct"
|
}
|
]
|
}
|
},
|
{
|
"#operator": "Distinct"
|
}
|
]
|
},
|
{
|
"#operator": "Order",
|
"sort_terms": [
|
{
|
"expr": "`version`"
|
}
|
]
|
},
|
{
|
"#operator": "FinalProject"
|
}
|
]
|
},
|
"text": "select DISTINCT SPLIT(`build`,'-')[0] AS version from `server` where `build` IS NOT NULL ORDER BY version"
|
}
|
],
|
"status": "success",
|
"metrics": {
|
"elapsedTime": "2.736994ms",
|
"executionTime": "2.707054ms",
|
"resultCount": 1,
|
"resultSize": 3654
|
}
|
}
|
Attachments
Issue Links
- blocks
-
MB-19612 4.5.1 Minor Release
- Closed