title: Cannot remove incorrectly created Hive table
body: <p>While working with Hive I accidentally submitted a CREATE TABLE as follows:</p>
  
  <pre><code>hive&gt; create external table hivetable(hiveid INT, hivename string) location '/';
  </code></pre>
  
  <p>The table created and now I can't remove it - if I select * from the table I get a huge output of gibberish data - for example:</p>
  
  <pre><code>NULL    �rg.4ӣ�7�-�j��&gt;�9Wϙ�U�m�eO�0���Un=7=W
  NULL    NULL
  NULL    NULL
  NULL    NULL
  NULL    NULL
  NULL    �s�2�+�q��GVZ�ur�*Y�M�s���G��R0
  NULL    c��ㇷ'o~8����e]�ay&gt;ѫjCE5
  NULL    �S�&amp;�M�I��S���"��p�
  NULL    NULL
  NULL    G2I|=i
  NULL    �Q?y����:R�T���QA6X�A+pI}�C?\��0Ek[�h�v�6�G�onය��^�;s4��
  NULL    �Og�oߟ���d|'���h�j7!��E;�o��    ���G���\�\��p��tm��Gwx��e����c�
                                                                         nñ*8�����U�&amp;|���B��ց�6��%��Ŵ⮶��)H�obN�3�?ܵ�$N�T��$2��p�$�f��hU��ڶ��Lg�!԰x)۔2/���RҭN�D����L�[��ٻ��˳�Ň���&lt;roi�W������jB���ס1L0&amp;���g��0�}��TV`c�.����Q�9n���*�D ����r"~0]5�
  NULL    NULL
  NULL    NULL
  NULL    NULL
  NULL    NULL
  NULL    ����_u�:g1^��}T�U�'����
                                 ����b���Ӳ�U9�fC�1�nI��H��
                                                          ����(
  </code></pre>
  
  <p>I'm thinking I've created a table which tried to read the entire HDFS filesystem directory structure - however I can't locate the table in HDFS, and although I can see the table in the default hive tables, I can't drop the table. As of right now I haven't noticed any impact, but I'd like to remove the table record and ensure everything in cleaned up. Any ideas?</p>
  
  <p>Thanks,
  Arthur</p>
  
  <p>EDIT:</p>
  
  <p>Error when trying to drop table:</p>
  
  <pre><code>    &gt; drop table hivetable;
  FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:java.lang.NullPointerException)
  hive&gt; 
  </code></pre>
  
  <p>I've since worsened the situation:</p>
  
  <pre><code>hive&gt; LOAD DATA LOCAL INPATH '/root/arthurs_stuff/empty.txt' OVERWRITE INTO TABLE hivetable;
  Loading data to table default.hivetable
  Moved: 'hdfs://sandbox.hortonworks.com:8020/app-logs' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/apps' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/ats' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/demo' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/flume' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/hdp' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/mapred' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/mr-history' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/ranger' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/root' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/spark-history' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Moved: 'hdfs://sandbox.hortonworks.com:8020/tmp' to trash at: hdfs://sandbox.hortonworks.com:8020/user/root/.Trash/Current
  Table default.hivetable stats: [numFiles=856, numRows=0, totalSize=574803295, rawDataSize=0]
  OK
  </code></pre>
  
  <p>followed by:</p>
  
  <pre><code>hadoop fs -mv /user/root/.Trash/Current/* /
  </code></pre>
  
  <p>Fortunately this is just a sandbox VM for study :) </p>
  
  <p>Perhaps I should just look at reformatting HDFS or something?</p>