title: Create Hive table and insert data from xls file
body: <p>I have gotten a project task from my supervisor who claims it is possible to use Hive within HDInsight (for Windows) in order to query two different file types and then extract data from them. One of these files is a .xls and the other a .csv file.</p>
  
  <p>I have managed to upload both of those files to the Hadoop cluster with VS and then tried creating a Hive table from the .xls file (I used tutorials before that made use of .csv files working just fine with Hive) but with the .xls file I constantly receive the "Failed" error when trying.</p>
  
  <p>I tried the following sample code for creating the table, delimiting, field termination (of which I tried several ones without success), file type (not sure what else to use here either) and target location.</p>
  
  <pre><code>DROP TABLE IF EXISTS table1;
  
  CREATE EXTERNAL TABLE IF NOT EXISTS table1(id int, postcde int, city string) 
      ROW FORMAT DELIMITED
      FIELDS TERMINATED BY ' ' 
      STORED AS TEXTFILE LOCATION 'wasb://container@resourcegroup.blob.core.windows.net/folder1/data.xls/'
  </code></pre>
  
  <p>I am unsure as to whether or not this is possible at all since there seem to be contradictory responses to a similar question here but according to my supervisor, there should be a possibility to do this with Hive - <strong>without having to convert file types to the same format before uploading to Hadoop!</strong></p>
  
  <p><a href="https://community.hortonworks.com/questions/31968/hi-is-there-a-way-to-load-xlsx-file-into-hive-tabl.html" rel="nofollow noreferrer">https://community.hortonworks.com/questions/31968/hi-is-there-a-way-to-load-xlsx-file-into-hive-tabl.html</a></p>