【发布时间】:2013-09-06 18:47:40
【问题描述】:
hive 0.10 中 T-SQL isnumeric() 函数的替代品是什么?
http://technet.microsoft.com/en-us/library/ms186272.aspx
【问题讨论】:
hive 0.10 中 T-SQL isnumeric() 函数的替代品是什么?
http://technet.microsoft.com/en-us/library/ms186272.aspx
【问题讨论】:
在 HIVE 中没有直接的等效项,但您可以使用 cast 函数。
将任何不是“数字”的内容转换为 double 将返回 null,您可以像这样使用它:select x from table where cast(field as double) is not null
【讨论】:
您可以通过以下检查来检查数字是否为十进制。这也可以在 where 子句中给出。
select case when abs(x%1)>0 then x else cast(x as bigint) end ;
【讨论】: