<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How to ask hive query to fetch data for specific partition? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-ask-hive-query-to-fetch-data-for-specific-partition/m-p/115206#M78000</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have posted query below in which i have used 3 partition table and all are the external table pointing to some partition ditectory on hdfs.In every table partition is done on "ds" column(i.e. ds=2016-06-01-08).&lt;/P&gt;&lt;P&gt;ds=year-month-day-hour&lt;/P&gt;&lt;P&gt;On hourly basis data is landing on hdfs,creating directory as above timestamp and tables are pointing to all those partition directories.&lt;/P&gt;&lt;P&gt;A question is:&lt;/P&gt;&lt;P&gt;As already i explained all tables are partitioned,but &lt;/P&gt;&lt;P&gt;Where to write where clause in below query? so that data will be processed for that particular partition only.&lt;/P&gt;&lt;P&gt;Please let me know.&lt;/P&gt;&lt;P&gt;Query:&lt;/P&gt;&lt;P&gt;INSERT OVERWRITE TABLE  falconexample.Patient_proce PARTITION (${falcon_output_partitions_hive}) select p.id,p.gender, p.Age, p.birthdate, o.component[1].valuequantity.value, o.component[1].valuequantity.unit from (select *, floor(datediff(to_date(from_unixtime(unix_timestamp())), to_date(birthdate)) / 365.25) as Age FROM falconexample. patient1) p inner join falconexample.DiagnosticReport1 d on p.id = substr(d.subject.reference,9) inner join falconexample.Observation1 o on p.id = substr(o.subject.reference,9) where p.Age&amp;gt;17 and p.Age&amp;lt;86 and o.component[1].valuequantity.value &amp;lt;140;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2016 00:23:52 GMT</pubDate>
    <dc:creator>Manus</dc:creator>
    <dc:date>2016-06-02T00:23:52Z</dc:date>
  </channel>
</rss>

