2017-08-08 109 views
0

我試圖使用Oozie Java動作來讀取Hive表,並且作業失敗,錯誤: 「java.io.IOException:NoSuchObjectException(message:sampleDB。測試表未找到)」使用Oozie Java動作無法連接到Hive

該表確實存在,如果我本身執行JAR,它完成罰款和做沒有問題蜂巢連接。

Oozie的一步:

<action name="sample-step"> 
    <java> 
     <job-tracker>${jobTracker}</job-tracker> 
     <name-node>${nameNode}</name-node> 
     <configuration> 
      <property> 
       <name>mapred.job.queue.name</name> 
       <value>${queueName}</value> 
      </property> 
     </configuration> 
     <main-class>com.test.mr.SampleDriver</main-class> 
     <java-opts></java-opts> 
     <arg>${DBName}</arg> 
     <arg>${InputTable}</arg> 
     <arg>${OutputTable}</arg> 
    </java> 
    <ok to="next-step" /> 
    <error to="failure-step" /> 
</action> 

我也試着設置蜂箱/ conf目錄/蜂房的site.xml,但沒有奏效

我能做些什麼來解決這個問題?由於

+0

你是什麼意思_「set hive/conf/hive-site.xml」_? **按照既定規則** >>上傳有效'蜂房site.xml'到HDFS,並告訴Oozie的在運行時下載它(在紗線容器的CWD,因此在CLASSPATH中)與''命令。 –

回答

0

嗨@Samson Scharfrichter。感謝您的答覆。我添加了如下所示的hive-site.xml,但它不起作用。是否需要在Map Reduce作業中添加任何其他配置。謝謝

<action name="sample-step"> 
    <java> 
     <job-tracker>${jobTracker}</job-tracker> 
     <name-node>${nameNode}</name-node> 
     <job-xml>${hiveSite}</job-xml> 
     <configuration> 
      <property> 
       <name>mapred.job.queue.name</name> 
       <value>${queueName}</value> 
      </property> 
     </configuration> 
     <main-class>com.test.mr.SampleDriver</main-class> 
     <java-opts></java-opts> 
     <arg>${DBName}</arg> 
     <arg>${InputTable}</arg> 
     <arg>${OutputTable}</arg> 
     <file>${hiveSite}#${hiveSite}</file> 
    </java> 
    <ok to="next-step" /> 
    <error to="failure-step" /> 
</action>