如何在Hive中实现百分位数? [英] How to implement percentile in Hive?
本文介绍了如何在Hive中实现百分位数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谁能告诉我,如何在Hive中实现百分位数? 我尝试使用百分位数功能,但无法获得预期的结果. 示例代码将极大地帮助您.
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.
推荐答案
使用 percentile
功能,根据产品文档:
Use the percentile
function, as per the product documentation:
返回组中列的精确pth百分位数(不适用于浮点类型). p必须在0到1之间.注意:只能为整数值计算真实的百分位数.如果您输入的内容不是整数,请使用
PERCENTILE_APPROX
.
如果您无法获得预期结果",那么您将为问题添加更多细节,例如数据,查询和预期结果.
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.
这篇关于如何在Hive中实现百分位数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文