一、網上總結的報錯
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