Hive2升hive3报错
一、网上总结的报错
1、coalesce报错
FAILED: SemanticException [Error 10014]: Line 197:4 Wrong arguments ''10'': Unsafe compares
BETWEEN different types are disabled for safety reasons. If you know what you are doing,
please SET hive.strict.checks.type.safety to false
AND make sure that hive.mapred.mode is NOT SET to 'strict' to proceed. Note that you may get errors
OR incorrect results if you make a mistake while
USING some of the unsafe features.
hive.strict.checks.type.safety=false (默认是true)
2、MR任务失败
java.lang.ClassCastException: org.apache.hadoop.hive.ql.exec.vector.LongColumnVector cannot be cast to org.apache.hadoop.hive.ql.exec.vector.DecimalColumnVector
不使用向量化执行可以解决vector强转报错的问题,hive.vectorized.execution.enabled=false
3、关键字报错
FAILED: ParseException line 7:1 cannot recognize input near 'application' 'string' 'comment' IN column name OR constraint
解决:字段名application和Hive中关键字冲突了,application需要在字段两边加上引号。除此之外常用的还有date、user等。
4、from_unixtime默认时区修改
在Hive3.1.0之后所有时区都改成了UTC,导致类似from_unixtime的时间UDF处理结果都少了8小时。
代码变化:
将HIVE-12192中相关代码回滚。
引用文章:https://blog.csdn.net/zyzzxycj/article/details/107607873