編譯oozie4.2.0遇到問題
版本說明:
jdk: 1.7
maven: 3.0.3
hadoop: 2.7.1
hive: 2.0.0
pig: 0.13
1. 在編譯的時候遇到
ShimLoader.getHadoopShims().setTokenStr(ugi, delegationToken,hiveConf.get("hive.metastore.token.signature"));
這行報錯,找不到方法。
原因:是因爲高版本hive-exec已經沒有該方法了,但是4.2.0release版本沒有解決該問題,github上版本已解決,
將該部分代碼替換爲:
Token<DelegationTokenIdentifier> token = new Token<DelegationTokenIdentifier>();
token.decodeFromUrlString(delegationToken);
token.setService(new Text(hiveConf.get("hive.metastore.token.signature")));
ugi.addToken(token);
問題解決
2. 使用hive2.0.0
需要提高jline版本,否則運行hive任務可能報錯
<dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>2.12</version> <!--默認是0.9.94-->
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>