HiveQL - 如何查找列值是数字还是不使用任何 UDF? [英] HiveQL - How to find the column value is numeric or not using any UDF?
本文介绍了HiveQL - 如何查找列值是数字还是不使用任何 UDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
基本上我想根据一个列值
返回行
.
如果该列包含非数字
值,则从 hive 表中返回这些行.
If the column contains non numeric
values, then return those rows from a hive table.
Hive
中是否有任何 UDF
可用?
Any UDF
is available in Hive
?
推荐答案
我相信 Hive 支持 rlike
(正则表达式).所以,你可以这样做:
I believe Hive supports rlike
(regular expressions). So, you can do:
where col rlike '[^0-9]'
这会查找任何非数字字符.如果您的数值可能有小数点或逗号,您可以扩展它.
This looks for any non-digit character. You can expand this, if your numeric values might have decimal points or commas.
这篇关于HiveQL - 如何查找列值是数字还是不使用任何 UDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文