hive0.11升级问题小结
在参数为null时会报错:
|
1
2
3
|
hive>
select
unix_timestamp(
null
)
from
default
.dual limit 5;
FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments
'TOK_NULL'
: The
function
UNIX_TIMESTAMP takes
only
string
or
timestamp
types
|
|
1
|
(
case
when
ddtime
is
null
then
null
else
unix_timestamp(ddtime)
end
)
|
|
1
2
|
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException:
java.lang.NullPointerException
|
|
1
2
3
|
java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException
: Hive Runtime Error
while
processing row [Error getting row data with
exception java.lang.ArrayIndexOutOfBoundsException: xxxx
|
https://issues.apache.org/jira/browse/HIVE-5056
bugid:
https://issues.apache.org/jira/browse/HIVE-2693
在hive0.11引入了decimal的类型,如果是double的类型可以通过cast(xxx as decimal)来解决
|
1
|
select
cast(2.3333 as decimal)+cast(12.55 as decimal) from dual;
|
以后遇到问题再来补充。
本文转自菜菜光 51CTO博客,原文链接:http://blog.51cto.com/caiguangguang/1393670,如需转载请自行联系原作者