Description
My environment is a single bucket with a primary index on that bucket. a sample document is attatched at the bottom, logs will be attached. The last time I saw this passing was in vulcan -1552.
This REST query:
curl -u Administrator:password http://192.168.10.10:8093/query/service -d 'statement=UPDATE default a set name = "new_name" where "centos" in ( SELECT RAW VMs.os FROM a.VMs) limit 2 returning a.name'
Returns:
curl: (52) Empty reply from server
But if you run this query against the server in the UI it returns:
[
{
"name": "new_name"
},
{
"name": "new_name"
}
]
The explain is here:
{
"plan": {
"#operator": "Sequence",
"~children": [
{
"#operator": "PrimaryScan",
"as": "a",
"index": "#primary",
"keyspace": "default",
"namespace": "default",
"using": "gsi"
},
{
"#operator": "Sequence",
"~children": [
{
"#operator": "Parallel",
"~child": {
"#operator": "Sequence",
"~children": [
{
"#operator": "Fetch",
"as": "a",
"keyspace": "default",
"namespace": "default"
},
{
"#operator": "Filter",
"condition": "(\"centos\" in (select raw (`VMs`.`os`) from (`a`.`VMs`)))"
}
]
}
},
{
"#operator": "Limit",
"expr": "2"
},
{
"#operator": "Parallel",
"~child": {
"#operator": "Sequence",
"~children": [
{
"#operator": "Clone"
},
{
"#operator": "Set",
"set_terms": [
{
"path": "(`a`.`name`)",
"value": "\"new_name\""
}
]
},
{
"#operator": "SendUpdate",
"alias": "a",
"keyspace": "default",
"limit": "2",
"namespace": "default"
},
{
"#operator": "InitialProject",
"result_terms": [
{
"expr": "(`a`.`name`)"
}
]
},
{
"#operator": "FinalProject"
}
]
}
}
]
}
]
},
"text": "UPDATE default a set name = \"new_name\" where \"centos\" in ( SELECT RAW VMs.os FROM a.VMs) limit 2 returning a.name"
}
Sample document:
{
"VMs": [
{
"RAM": 10,
"memory": 10,
"name": "vm_10",
"os": "ubuntu"
},
{
"RAM": 10,
"memory": 10,
"name": "vm_11",
"os": "windows"
},
{
"RAM": 10,
"memory": 10,
"name": "vm_12",
"os": "centos"
},
{
"RAM": 10,
"memory": 10,
"name": "vm_13",
"os": "macos"
}
],
"_id": "query-testemployee10153.1877827-0",
"address": [
[
{
"city": "Delhi"
},
{
"street": "12th street"
}
],
[
{
"apartment": 123,
"country": "EUROPE"
}
]
],
"department": "Support",
"email": "9-mail@couchbase.com",
"hobbies": {
"hobby": [
{
"sports": [
"Badminton",
"Football",
"Basketball"
]
},
{
"dance": [
"hip hop",
"bollywood",
"contemporary"
]
},
"art"
]
},
"join_yr": [
2013,
2015,
2012
],
"mutated": 0,
"name": "new_name",
"tasks": [
{
"Developer": [
"IOS",
"Indexing"
],
"Marketing": [
{
"region1": "South",
"region2": "International"
},
{
"region2": "South"
}
]
},
"Sales",
"QA"
]
}
Attachments
For Gerrit Dashboard: MB-27362 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
87293,3 | MB-27362 update + limit corner case | master | query | Status: MERGED | +2 | +1 |