title: External Partitioning in hive according to year,month and date format
body: <p>I am using microsoft azure HDInsight. I have the data in the below format.</p>
  
  <p>container/folder/year/month/date/file1.csv</p>
  
  <p>container/folder/year/month/date/file2.csv
  .
  .
  .and so on.</p>
  
  <p>I created an external table with partitions using below queries</p>
  
  <pre><code>'drop table partition;
  CREATE EXTERNAL TABLE partition (id string, event timestamp and so on)
  PARTITIONED BY (year INT, month INT, day INT)
  ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
  STORED AS TEXTFILE'
  </code></pre>
  
  <p>Got the output that the query submitted was successful and external table was created.</p>
  
  <p>Then gave the Alter command to add the partition.</p>
  
  <pre><code>'ALTER TABLE partition ADD PARTITION(year=2014, month=1, day=1)
   LOCATION'wasb://$containerName@$storageAccountName.blob.core.windows.net/containerName/folderName/2014/01/01';'
  </code></pre>
  
  <p>Did not get any errors even here.</p>
  
  <p>Then when i gave a simple select statement, i couldn't retrieve anything from the data files.</p>
  
  <pre><code>'select * from partition where year=2014 AND month=01 AND day=01 limit 10;'
  </code></pre>
  
  <p>and also tried</p>
  
  <pre><code>'select * from partition limit 10;'
  </code></pre>
  
  <p>Both the select statement did not return anything. Unable to figure what went wrong. Any suggestions please?</p>