hive 0.10中的T-SQL isnumeric()
函数的替换是什么?
http://technet.microsoft.com/en-us/library/ms186272.aspx
答案 0 :(得分:10)
HIVE中没有直接的等效物,但您可以使用cast
功能
将任何非“数字”的内容转换为double
将返回null,您可以像这样使用它:
select x from table where cast(field as double) is not null
答案 1 :(得分:0)
您可以通过以下检查检查数字是否为小数。这也可以在where子句中给出。
选择abs(x%1)> 0时的情况,然后选择x else else cast(x as bigint)结束;