How to implement percentile in Hive?

被刻印的时光 ゝ 提交于 2019-12-13 11:22:09

问题


Can anyone please tell me ,how to implement Percentile in Hive? I tried with percentile function,but not able to get the expected result. Example code will greatly help.


回答1:


Use the percentile function, as per the product documentation:

Returns the exact pth percentile of a column in the group (does not work with floating point types). p must be between 0 and 1. NOTE: A true percentile can only be computed for integer values. Use PERCENTILE_APPROX if your input is non-integral.

If you are not able to get 'expected result' then your going to add a lot more detail to your question, as in what is the data, your query, and the expected result.



来源:https://stackoverflow.com/questions/35146395/how-to-implement-percentile-in-hive

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!