OOZIE workflow: HIVE table did not exists but directory created in HDFS
<p>I am trying to run a <code>HIVE</code> action using a <code>OOZIE</code> workflow. Below is the hive action:</p>

<p><code>create table abc (a INT);</code></p>

<p>I can locate the internal table in HDFS (directory <code>abc</code> getting created under <code>/user/hive/warehouse</code>) but when I trigger the command <code>SHOW TABLES</code> from <code>hive&gt;</code>, I am not able to see the table.</p>

<p>This is the <code>workflow.xml</code> file:</p>

<pre><code>&lt;workflow-app xmlns="uri:oozie:workflow:0.2" name="hive-wf"&gt;
 &lt;start to="hiveac"/&gt;
 &lt;action name="hiveac"&gt;
    &lt;hive xmlns="uri:oozie:hive-action:0.2"&gt;
            &lt;job-tracker&gt;${jobTracker}&lt;/job-tracker&gt;
            &lt;name-node&gt;${nameNode}&lt;/name-node&gt;
            &lt;!-- &lt;prepare&gt; &lt;delete path="${nameNode}/user/${wf:user()}/case1/out"/&gt; &lt;/prepare&gt; --&gt;
        &lt;!-- &lt;job-xml&gt;hive-default.xml&lt;/job-xml&gt;--&gt;
            &lt;configuration&gt;
                &lt;property&gt;
                    &lt;name&gt;oozie.hive.defaults&lt;/name&gt;
                    &lt;value&gt;hive-default.xml&lt;/value&gt;
                &lt;/property&gt;
                &lt;property&gt;
                    &lt;name&gt;mapred.job.queue.name&lt;/name&gt;
                    &lt;value&gt;${queueName}&lt;/value&gt;
                &lt;/property&gt;
            &lt;/configuration&gt;
            &lt;script&gt;script.q&lt;/script&gt;
            &lt;!-- &lt;param&gt;INPUT=/user/${wf:user()}/case1/sales_history_temp4&lt;/param&gt;
            &lt;param&gt;OUTPUT=/user/${wf:user()}/case1/out&lt;/param&gt; --&gt;
        &lt;/hive&gt;
  &lt;ok to="end"/&gt;
  &lt;error to="fail"/&gt;
 &lt;/action&gt;
   &lt;kill name="fail"&gt;
   &lt;message&gt;Pig Script failed!!!&lt;/message&gt;
   &lt;/kill&gt;
   &lt;end name="end"/&gt;
&lt;/workflow-app&gt;
</code></pre>

<p>This is the <code>hive-default.xml</code> file:</p>

<pre><code>&lt;configuration&gt;
&lt;property&gt;
  &lt;name&gt;javax.jdo.option.ConnectionURL&lt;/name&gt;
  &lt;value&gt;jdbc:mysql://localhost/metastore&lt;/value&gt;
  &lt;description&gt;JDBC connect string for a JDBC metastore&lt;/description&gt;
&lt;/property&gt;

&lt;property&gt;
  &lt;name&gt;javax.jdo.option.ConnectionDriverName&lt;/name&gt;
  &lt;value&gt;org.apache.derby.jdbc.EmbeddedDriver&lt;/value&gt;
  &lt;description&gt;Driver class name for a JDBC metastore&lt;/description&gt;
&lt;/property&gt;

&lt;property&gt;
  &lt;name&gt;javax.jdo.option.ConnectionUserName&lt;/name&gt;
  &lt;value&gt;hiveuser&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
  &lt;name&gt;javax.jdo.option.ConnectionPassword&lt;/name&gt;
  &lt;value&gt;password&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
  &lt;name&gt;datanucleus.autoCreateSchema&lt;/name&gt;
  &lt;value&gt;false&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
  &lt;name&gt;datanucleus.fixedDatastore&lt;/name&gt;
  &lt;value&gt;true&lt;/value&gt;
&lt;/property&gt;
&lt;property&gt;
  &lt;name&gt;hive.stats.autogather&lt;/name&gt;
  &lt;value&gt;false&lt;/value&gt;
&lt;/property&gt;
&lt;/configuration&gt;
</code></pre>

<p>This is the <code>job.properties</code> file:</p>

<pre><code>nameNode=hdfs://localhost:8020
jobTracker=localhost:8021
queueName=default
oozie.libpath=/user/oozie/shared/lib
#oozie.use.system.libpath=true
oozie.wf.application.path=${nameNode}/user/my/jobhive
</code></pre>

<p>The logs did not gave any errors as such:</p>

<pre><code>stderr logs

Logging initialized using configuration in jar:file:/var/lib/hadoop-hdfs/cache/mapred/mapred/local/taskTracker/distcache/3179985539753819871_-620577179_884768063/localhost/user/oozie/shared/lib/hive-common-0.9.0-cdh4.1.1.jar!/hive-log4j.properties
Hive history file=/tmp/mapred/hive_job_log_mapred_201603060735_17840386.txt
OK
Time taken: 9.322 seconds
Log file: /var/lib/hadoop-hdfs/cache/mapred/mapred/local/taskTracker/training/jobcache/job_201603060455_0012/attempt_201603060455_0012_m_000000_0/work/hive-oozie-job_201603060455_0012.log  not present. Therefore no Hadoop jobids found
</code></pre>

<p>I came across a similar thread: <a href="https://stackoverflow.com/questions/18709840/tables-created-by-oozie-hive-action-cannot-be-found-from-hive-client-but-can-fin">Tables created by oozie hive action cannot be found from hive client but can find them in HDFS</a></p>

<p>But this did not resolved my issue. Please let me know how to resolve this issue.</p>