I am using elastic 6.4, and using /_xpack/sql to output some columns. Due to use order by command, have to average number columns that output just have 1 decimal place.
In my case, I use my local vbox with ubuntu 18.04 and elasticsearch sql can output many decimal place, but I using the redhat machine that it output the average column like 0.0.
Hi @zxc654951,
I see that every time you get 0.0 you are using index logstash_t2_2018_11_23. A fair test between two different machines would be the same query on the same index. But, in your case, you perform the query on two different indices. To me, your tests don't seem relevant for the issue.
Please, test the same query on the same index on both machines (the one showing 0.0 and the one showing "good" numbers).
Sorry, I can't got the logstash_t2_2018_11_23 or logstash_t2_2018_11_23 because I delete those indices. Therefor, I got "good" numbers with delete all indices and re-logstash data. It query normally now, but I consider deleted that is not a good solution.
My assumption is that the index you tested on didn't have good data in it. And, thus, you got the 0.0 everywhere. Next time you notice this issue, please test the same query on the same index on multiple machines.
Thanks.
Two machine load difference data source but the server's settings are same. Queryed data maybe not like you want.
Some problem is the same index in same machine which will query different result with time pass and indices grow. If I get it again then I will update the content. Thanks.
When I change the query index, the results are different for elapsed_time that one is decimal and another is 0.0. But in the discover is show the elapsed_time is good. Because this query problem, I can't average the elapsed_time. Maybe my English is poor to show my problem, but I hope some people can tell me how to solve this problem. Thanks a lot.
The data type didn't change. If this is data coming from Logstash and you don't have an index template in which you specifically say that elapsed_time should be float then Elasticsearch will guess the type of the field from the first document that comes to the index. If it happens that the first value coming in doesn't have decimals, then Elasticsearch will not make that field a float.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.