title: Hive external table is unable to read already partitioned hdfs directory
body: <p>I have a map reduce job, that already writes out record to hdfs using hive partition naming convention.</p>
  
  <p>eg</p>
  
  <pre><code>/user/test/generated/code=1/channel=A
  /user/test/generated/code=1/channel=B
  </code></pre>
  
  <p>After I create an external table, it does not see the  partition.</p>
  
  <pre><code> create external table test_1 ( id string, name string ) partitioned by
   (code string, channel string) STORED AS PARQUET LOCATION
   '/user/test/generated'
  </code></pre>
  
  <p>Even with the alter command </p>
  
  <blockquote>
    <p>alter table test_1 ADD PARTITION (code = '1', channel = 'A')</p>
  </blockquote>
  
  <p>, it does not see the partition or record,
  because </p>
  
  <blockquote>
    <p>select * from test_1 limit 1 produces 0 result.</p>
  </blockquote>
  
  <p>If I use empty location when I create external table, and then use 
  load data inpath ... 
  then it works. But the issue is there is too many partitions for the load data inpath to work.</p>
  
  <p>Is there a way to make hive recognize the partition automatically (without doing insert query)?</p>