<?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 (Hive) Query to pull data under a same parition with different timestamps ? for example partition_dt=2017-01-03 10%3A20%3A13, partition_dt=2017-01-03 10%3A20%3A14, partition_dt=2017-01-03 10%3A20%3A15 in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110981#M50721</link>
    <description />
    <pubDate>Wed, 04 Jan 2017 04:56:12 GMT</pubDate>
    <dc:creator>t_sankar85</dc:creator>
    <dc:date>2017-01-04T04:56:12Z</dc:date>
    <item>
      <title>How to (Hive) Query to pull data under a same parition with different timestamps ? for example partition_dt=2017-01-03 10%3A20%3A13, partition_dt=2017-01-03 10%3A20%3A14, partition_dt=2017-01-03 10%3A20%3A15</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110981#M50721</link>
      <description />
      <pubDate>Wed, 04 Jan 2017 04:56:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110981#M50721</guid>
      <dc:creator>t_sankar85</dc:creator>
      <dc:date>2017-01-04T04:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to (Hive) Query to pull data under a same parition with different timestamps ? for example partition_dt=2017-01-03 10%3A20%3A13, partition_dt=2017-01-03 10%3A20%3A14, partition_dt=2017-01-03 10%3A20%3A15</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110982#M50722</link>
      <description>&lt;P&gt;To query across multiple partitions, you should not need to anything special, other than make sure your where clause is not forcing you into a specific folder. E.g. do not include partition_dt in your query.&lt;/P&gt;&lt;P&gt;One comment: Avoid too many partitions. Avoid partitioning that is too granular (unless you are pruning old data) as you will suffer performance problems. I recommend taking a look at &lt;A target="_blank" href="https://community.hortonworks.com/questions/29031/best-pratices-for-hive-partitioning-especially-by.html"&gt;this article for some best practices on Hive partitioning&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jan 2017 05:23:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110982#M50722</guid>
      <dc:creator>clukasik</dc:creator>
      <dc:date>2017-01-04T05:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to (Hive) Query to pull data under a same parition with different timestamps ? for example partition_dt=2017-01-03 10%3A20%3A13, partition_dt=2017-01-03 10%3A20%3A14, partition_dt=2017-01-03 10%3A20%3A15</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110983#M50723</link>
      <description>&lt;P&gt;@clukasik- Thanks for your reply.&lt;/P&gt;&lt;P&gt;Table is loaded 3 times today.I would like to know count for each partition. I tried to run a query "select count(*) from db.tablename where partition_dt="2017-01-03 10%3A20%3A13" , tried like keyword both did not give results.&lt;/P&gt;&lt;P&gt;Note: select count(*)f rom db.table where partition_dt ='2017-01-03' gives count for the day.&lt;/P&gt;&lt;P&gt;I Agree with your comment, but it is an existing application. I will make sure new design won't have too many partitions.&lt;/P&gt;&lt;H1&gt;&lt;/H1&gt;</description>
      <pubDate>Wed, 04 Jan 2017 09:21:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110983#M50723</guid>
      <dc:creator>t_sankar85</dc:creator>
      <dc:date>2017-01-04T09:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to (Hive) Query to pull data under a same parition with different timestamps ? for example partition_dt=2017-01-03 10%3A20%3A13, partition_dt=2017-01-03 10%3A20%3A14, partition_dt=2017-01-03 10%3A20%3A15</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110984#M50724</link>
      <description>&lt;P&gt;Would this work?&lt;/P&gt;&lt;PRE&gt;select partition_dt, count(*) from db.tablename group by partition_dt&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Jan 2017 01:13:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110984#M50724</guid>
      <dc:creator>clukasik</dc:creator>
      <dc:date>2017-01-05T01:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to (Hive) Query to pull data under a same parition with different timestamps ? for example partition_dt=2017-01-03 10%3A20%3A13, partition_dt=2017-01-03 10%3A20%3A14, partition_dt=2017-01-03 10%3A20%3A15</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110985#M50725</link>
      <description>&lt;P&gt;@clukasik - Thanks for the reply. I tried your query and it worked , here is my observations. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;show partitions tablename;&lt;/P&gt;&lt;P&gt;partition_dt=2017-01-03 10%3A20%3A13 
partition_dt=2017-01-03 10%3A20%3A14 
partition_dt=2017-01-03 10%3A20%3A15 &lt;/P&gt;&lt;P&gt;
select patition_dt, count(1) from tablename group by partition_dt;&lt;/P&gt;&lt;P&gt;2017-01-03 10:20:13.0  | 2191  
2017-01-03 10:20:14.0  | 7888 
2017-01-03 10:20:15.0  | 1647 &lt;/P&gt;&lt;P&gt;
Note: %3A should be replaced with : while quering. &lt;/P&gt;&lt;P&gt;select count(1) from  tablename where partition_dt="2017-01-03 10:20:13";
+-------+--+
|  _c0  |
+-------+--+
| 2191  |
+-------+--+
1 row selected (3.643 seconds)&lt;/P&gt;&lt;P&gt;select count(1) from  tablename where partition_dt="2017-01-03 10:20:14";
+-------+--+
|  _c0  |
+-------+--+
| 7888  |
+-------+--+
1 row selected (0.101 seconds)&lt;/P&gt;&lt;P&gt;select count(1) from  tablename where partition_dt="2017-01-03 10:20:15";
+-------+--+
|  _c0  |
+-------+--+
| 1647  |
+-------+--+
1 row selected (0.101 seconds)&lt;/P&gt;&lt;P&gt;Sampling i used below query.&lt;/P&gt;&lt;P&gt; select * from tablename where partition_dt="2017-01-03 10:20:15" limit 5;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 03:56:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-Hive-Query-to-pull-data-under-a-same-parition-with/m-p/110985#M50725</guid>
      <dc:creator>t_sankar85</dc:creator>
      <dc:date>2017-01-05T03:56:32Z</dc:date>
    </item>
  </channel>
</rss>

