Description
While running following query as curl
SELECT name, (SELECT raw avg(s.ratings.Overall) FROM t.reviews as s)[0] AS overall_avg_rating FROM `travel_ds` AS t WHERE `type` = "hotel" ORDER BY overall_avg_rating DESC LIMIT 3
|
Response from cbas
curl -X POST http://10.142.180.102:8095/analytics/service -H 'authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==' -H 'cache-control: no-cache' -H 'content-type: application/json' -d ' {"pretty": true, "client_context_id": "", "timeout": "120s", "$ty":"hotel", "statement": "SELECT name, (SELECT raw avg(s.ratings.Overall) FROM t.reviews as s)[0] AS overall_avg_rating FROM `travel_ds` AS t WHERE `type` = $ty ORDER BY overall_avg_rating DESC LIMIT 3"}'
|
{
|
"requestID": "506053a9-a8a1-45ea-8f15-fe8cb2f6a6bf",
|
"signature": {
|
"*": "*"
|
},
|
"results": [ {
|
"name" : "Culloden House Hotel",
|
"overall_avg_rating" : 5.0
|
}, {
|
"name" : "The Bulls Head",
|
"overall_avg_rating" : 5.0
|
}, {
|
"name" : "La Pradella",
|
"overall_avg_rating" : 5.0
|
} ]
|
,
|
"plans":{},
|
"status": "success",
|
"metrics": {
|
"elapsedTime": "393.10119ms",
|
"executionTime": "383.792182ms",
|
"resultCount": 3,
|
"resultSize": 189,
|
"processedObjects": 31591
|
}
|
}
|
Response from n1ql
curl -X POST http://10.142.180.101:8093/query -H 'authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==' -H 'cache-control: no-cache' -H 'content-type: application/json' -H 'postman-token: 026ffa82-6b30-6d1f-5e4c-76707ebedb6e' -d ' {"pretty": true, "client_context_id": "", "timeout": "120s", "$ty":"hotel", "statement": "SELECT name, (SELECT raw avg(s.ratings.Overall) FROM t.reviews as s)[0] AS overall_avg_rating FROM `travel-sample` AS t WHERE `type` = $ty ORDER BY overall_avg_rating DESC LIMIT 3"}'
|
{
|
"requestID": "3301fa70-6b33-4daa-b1ae-e96f5802ae2e",
|
"signature": {
|
"name": "json",
|
"overall_avg_rating": "json"
|
},
|
"results": [
|
{
|
"name": "Culloden House Hotel",
|
"overall_avg_rating": 5
|
},
|
{
|
"name": "The Bulls Head",
|
"overall_avg_rating": 5
|
},
|
{
|
"name": "La Pradella",
|
"overall_avg_rating": 5
|
}
|
],
|
"status": "success",
|
"metrics": {
|
"elapsedTime": "361.966217ms",
|
"executionTime": "361.839013ms",
|
"resultCount": 3,
|
"resultSize": 258,
|
"sortCount": 917
|
}
|
}
|
Observation : overall_avg_rating is 5.0 in cbas but 5 in n1ql , Also UI shows 5 for both.
Automated tests are failing because of the difference
Attachments
Issue Links
- relates to
-
MB-29497 [CX] Remove trailing ".0" when printing float/double values
- Open