title: Pig Script: STORE command not working
body: <p>this is my first time posting to StackOverflow and I'm hoping someone can assist. I'm fairly new at pig scripts and have encountered a problem I can't solve.</p>
  
  <p>Below is a pig script that fails when I attempt to write results to a file:</p>
  
  <pre><code>register 'myudf.py' using jython as myfuncs;
  A = LOAD '$file_nm' USING PigStorage('$delimiter') AS ($fields);
  B = FILTER A by ($field_nm) IS NOT NULL;
  C = FOREACH B GENERATE ($field_nm) as fld;
  D = GROUP C ALL;
  E = FOREACH D GENERATE myfuncs.theResult(C.fld);
  --DUMP E;
  STORE E INTO 'myoutput/theResult';
  EXEC;
  </code></pre>
  
  <p>I see the results of E when I Dump to the screen. However, I need to store the results temporarily in a file. After the Store command, the error I receive is: <strong>Output Location Validation Failed</strong>. </p>
  
  <p>I've tried numerous workarounds, like removing the theResult folder and removing the earlier contents of theResult, but none of the commands I use work. These have been along the lines of:</p>
  
  <pre><code>hdfs dfs -rm myoutput/theResult
  </code></pre>
  
  <p>and</p>
  
  <pre><code>hadoop fs -rm myoutput/theResult
  </code></pre>
  
  <p>...using both the shell (hs) and file system (fs) commands. I've tried to call another function (shell script, python function, etc.) to clear the earlier results stored in the myoutput/theResult folder. I've read every website I can find and nothing is working. Any ideas??</p>