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.