title: how to make hive take only specific files as input from hdfs folder
body: <p>I have the following folder structure in hdfs </p>
  
  <pre><code>  /input/data/yyyy/mm/dd/
  </code></pre>
  
  <p>and inside it data files, for example:</p>
  
  <pre><code>/input/data/2013/05/01/
        file_2013_05_01_01.json // file format yyyy_mm_dd_hh
        file_2013_05_01_02.json // file format yyyy_mm_dd_hh
        ....
  </code></pre>
  
  <p>I've defined hive external table for this folder:</p>
  
  <pre><code>CREATE EXTERNAL TABLE input_data (
      vr INT, ....
  )
  PARTITIONED BY (tsp STRING)
  ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe'
  STORED AS TEXTFILE;
  </code></pre>
  
  <p>adding for each folder a partition as following: </p>
  
  <pre><code>   alter table input_data ADD PARTITION (tsp="2013-05-01") LOCATION '/input/data/2013/05/01/';
  </code></pre>
  
  <p>The following query will take as input all files in date 2013-05-01</p>
  
  <pre><code>select ... from input_data where tps="2013-05-01"
  </code></pre>
  
  <p>How can I take only files of specific hour? without changing the hdfs structure to put each hour in separate folder?</p>