title: Loading Data from a .txt file to Table Stored as ORC in Hive
body: <p>I have a data file which is in <code>.txt</code> format. I am using the file to load data into Hive tables. When I load the file in a table like </p>
  
  <pre><code>CREATE TABLE test_details_txt(
  visit_id INT,
  store_id SMALLINT) STORED AS TEXTFILE;
  </code></pre>
  
  <p>the data is loaded correctly using </p>
  
  <pre><code>LOAD DATA LOCAL INPATH '/home/user/test_details.txt' INTO TABLE test_details_txt;
  </code></pre>
  
  <p>and I can run a <code>SELECT * FROM test_details_txt;</code> on the table in Hive.</p>
  
  <p>However If I try to load the data in a table that is </p>
  
  <pre><code>CREATE TABLE test_details_txt(
  visit_id INT,
  store_id SMALLINT) STORED AS ORC; 
  </code></pre>
  
  <p>I receive the following error on trying to run a SELECT:</p>
  
  <p><code>Failed with exception java.io.IOException:java.io.IOException: Malformed ORC file hdfs://master:6000/user/hive/warehouse/test.db/transaction_details/test_details.txt. Invalid postscript.</code></p>
  
  <p>While loading the data using above LOAD statement I do not receive any error or exception.</p>
  
  <p>Is there <strong>anything else that needs to be done</strong> while using the <code>LOAD DATA IN PATH..</code> command to store data into an ORC table?</p>