简体   繁体   English

HIVE表-获取最接近给定数值的记录

[英]HIVE table - Get records which are closest to a given numeric value

From a hive table, I want records which are closest to a given value of each of the columns. 从配置单元表中,我想要最接近每个列的给定值的记录。 Eg The table has columns - total_score, avg_score, etc. I want to get records which have total_score and avg_score close or equal to "a given value". 例如,该表具有列-total_score,avg_score等。我想获取具有total_score和avg_score接近或等于“给定值”的记录。

Note - Table has approx. 注意-桌子大约有 183 million rows and I want 1,50,000 records which are closest/equal to the given value of each of the columns. 1.83亿行,我想要1,50,000条记录,这些记录最接近/等于每列的给定值。

Please help me with the process of doing it. 请帮助我完成此过程。

一般概念必须是最高x,由参数值和列表中的值之差的绝对值排序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM