es version : 6.7
Hello i'm using elasticsearch sql api i found that results not correct when i add DISTINCT
es code
require('./elasticsearch/').transport.request({
method : "POST",
path : '/_xpack/sql',
body : {
query : "SELECT COUNT(DISTINCT id) FROM orders"
}
},(err,res) => {
console.log("error",err)
return res.status(200).send(res)
})
results :
{
"columns":[{"name":"COUNT(DISTINCT id)","type":"long"}],
"rows":[[11459]] <----------------------------------------------- MUST BE (11501)
}
i execute same query in mysql
SELECT COUNT(DISTINCT id) FROM orders
results
11501
Any Helps ? Thank you