title: creating partition in external table in hive
body: <p>I have successfully created and added <strong>Dynamic partitions</strong> in an <strong>Internal table</strong> in hive. i.e. by using following steps:</p>
  
  <p>1-created a source table</p>
  
  <p>2-loaded data from local into source table</p>
  
  <p>3- created another table with partitions - partition_table</p>
  
  <p>4- inserted the data to this table from source table resulting in creation of all the partitions dynamically</p>
  
  <p>My question is, how to perform this in external table? I read so many articles on this, but i am confused , that do I have to specify path to the already existing partitions for creating partitions for external table??</p>
  
  <p>example:
  Step 1:</p>
  
  <pre><code>create external table1 ( name string, age int, height int)
  location 'path/to/dataFile/in/HDFS';
  </code></pre>
  
  <p>Step 2:</p>
  
  <pre><code>alter table table1 add partition(age) 
  location 'path/to/already/existing/partition'
  </code></pre>
  
  <p>I am not sure how to proceed with partitioning in external tables. Can somebody please help by giving step by step description of the same?.</p>
  
  <p>Thanks in advance!</p>