title: how to use a shell-action from oozie to write to create a file in HDFS
body: <p>I am invoking the below shell-action to invoke a shell script which writes an output to a file.
  I have tried this on both IBM BigInsight and Cloudera but whenever I am trying to write to a new file in HDFS the job fails.</p>
  
  <p>I checked the application/job id logs but had no info.
  Is there any restriction to write to hdfs from a shell script.</p>
  
  <p>---sample.sh---</p>
  
  <pre><code>hive -e "create t1(id int); insert into t1 values(1);"
  hive -e "select * from t1;" &gt; /user/cloudera/test123/t1_data.txt
  </code></pre>
  
  <p>--workflow.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;workflow-app xmlns="uri:oozie:workflow:0.5" name="shell.workflow"&gt;
    &lt;start to="shell-node"/&gt;
      &lt;action name="shell-node"&gt;
          &lt;shell xmlns="uri:oozie:shell-action:0.1"&gt;
              &lt;job-tracker&gt;${jobTracker}&lt;/job-tracker&gt;
              &lt;name-node&gt;${nameNode}&lt;/name-node&gt;
              &lt;prepare&gt;
                 &lt;delete path="test123"/&gt;
                 &lt;mkdir path="test123"/&gt;
              &lt;/prepare&gt;
  
              &lt;configuration&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;exec&gt;sample.sh&lt;/exec&gt;
              &lt;env-var&gt;HADOOP_USER_NAME=cloudera&lt;/env-var&gt;
              &lt;file&gt;hdfs://localhost:8020/user/cloudera/oozietest/sample.sh#sample.sh&lt;/file&gt;
              &lt;capture-output/&gt;
          &lt;/shell&gt;
          &lt;ok to="end"/&gt;
          &lt;error to="kill"/&gt;
      &lt;/action&gt;
          &lt;kill name="kill"&gt;
              &lt;message&gt;Error in Shell.Please refer the Oozie Logs&lt;/message&gt;
           &lt;/kill&gt;
  &lt;end name="end"/&gt;
  &lt;/workflow-app&gt;
  </code></pre>
  
  <p>--job.properties</p>
  
  <pre><code>nameNode=hdfs://localhost:8020
  jobTracker=localhost:8032
  master=yarn-cluster
  user.name=cloudera
  queueName=default
  examplesRoot=oozietest
  oozie.use.system.libpath=true
  oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}
  </code></pre>