title: How does hive handle insert into internal partition table?
body: <p>I have a requirement to insert streaming of records into Hive partitioned table. The table structure is something like</p>
  
  <pre><code>CREATE TABLE store_transation (
       item_name string,
       item_count int,
       bill_number int,
  ) PARTITIONED BY (
     yyyy_mm_dd string
  );
  </code></pre>
  
  <p>I would like to understand how Hive handles inserts in the internal table.</p>
  
  <p>Does all record insert into a single file inside the
      <strong>yyyy_mm_dd=2018_08_31</strong> directory? Or hive splits into multiple files inside a partition, if so when?</p>
  
  <p>Which one performs well from the following in case of per day 1 million records and the querying pattern is going to be between date range?</p>
  
  <ol>
  <li>No partition in the internal table</li>
  <li>Partition by date, each date has only one file</li>
  <li>Partition by date, each date has more than one file</li>
  </ol>