title: automatically partition Hive tables based on S3 directory names
body: <p>I have data stored in S3 like:</p>
  
  <pre><code>/bucket/date=20140701/file1
  /bucket/date=20140701/file2
  ...
  /bucket/date=20140701/fileN
  
  /bucket/date=20140702/file1
  /bucket/date=20140702/file2
  ...
  /bucket/date=20140702/fileN
  ...
  </code></pre>
  
  <p>My understanding is that if I pull in that data via Hive, it will automatically interpret <code>date</code> as a partition. My table creation looks like:</p>
  
  <pre><code>CREATE EXTERNAL TABLE search_input(
     col 1 STRING,
     col 2 STRING,
     ...
  
  )
  PARTITIONED BY(date STRING)
  ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
  LINES TERMINATED BY '\n'
  LOCATION 's3n://bucket/';
  </code></pre>
  
  <p>However Hive doesn't recognize any data. Any queries I run return with 0 results. If I instead just grab one of the dates via:</p>
  
  <pre><code>CREATE EXTERNAL TABLE search_input_20140701(
     col 1 STRING,
     col 2 STRING,
     ...
  
  )
  ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
  LINES TERMINATED BY '\n'
  LOCATION 's3n://bucket/date=20140701';
  </code></pre>
  
  <p>I can query data just fine.</p>
  
  <p>Why doesn't Hive recognize the nested directories with the "date=date_str" partition?
  Is there a better way to have Hive run a query over multiple sub-directories and slice it based on a datetime string?</p>