<?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 Re: unable to create unique partitions in hive in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/unable-to-create-unique-partitions-in-hive/m-p/278913#M208321</link>
    <description>&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/18663"&gt;@priyanka1_munja&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Are you complaining that same partition appears multiple times? Did you notice the extra space before some of the partition keys? For example, "03-04-2015" vs " 03-04-2015"? I think that's the reason for the duplicates.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Eric</description>
    <pubDate>Sun, 06 Oct 2019 22:11:26 GMT</pubDate>
    <dc:creator>EricL</dc:creator>
    <dc:date>2019-10-06T22:11:26Z</dc:date>
    <item>
      <title>unable to create unique partitions in hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/unable-to-create-unique-partitions-in-hive/m-p/278898#M208310</link>
      <description>&lt;P&gt;I am using cloudera virtual box. while creating partitions, it is creating all the partitions whether they are unique or not&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;create table product_order1(id int,user_id int,amount int,product string, city string, txn_date string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';&lt;/PRE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;PRE&gt;LOAD DATA LOCAL INPATH 'txn' INTO TABLE product_order1;
Loading data to table oct19.product_order1
Table oct19.product_order1 stats: [numFiles=1, totalSize=303]&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="diff-delete"&gt;OK Time&lt;/SPAN&gt; taken: 0.426 seconds&lt;/P&gt;&lt;PRE&gt;hive&amp;gt; 
&amp;gt; set hive.exec.dynamic.partition = true;
hive&amp;gt; 
&amp;gt; set hive.exec.dynamic.partition.mode = true;

hive&amp;gt; 
&amp;gt; create table dyn_part(id int,user_id int,amount int,product string,city string) PARTITIONED BY(txn_date string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t';&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="diff-delete"&gt;OK Time&lt;/SPAN&gt; taken: 0.14 seconds&lt;/P&gt;&lt;PRE&gt;hive &amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="diff-delete"&gt;INSERT OVERWRITE TABLE dyn_part PARTITION(txn_date) select id,user_id,amount,product,city,txn_date from product_order1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Result which i have received :-&lt;/P&gt;&lt;PRE&gt;Loading data to table oct19.dyn_part partition (txn_date=null)
 Time taken for load dynamic partitions : 944
Loading partition {txn_date=04-02-2015}
Loading partition {txn_date= 03-04-2015}
Loading partition {txn_date=01-02-2015}
Loading partition {txn_date=03-04-2015}
Loading partition {txn_date= 01-01-2015}
Loading partition {txn_date=01-01-2015}
Loading partition {txn_date= 01-02-2015}
 Time taken for adding to write entity : 5&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="diff-delete"&gt;Partition oct19.dyn_part{txn_date= 01-01-2015} stats: [numFiles=1, numRows=1, totalSize=25, rawDataSize=24] Partition oct19.dyn_part{txn_date= 01-02-2015} stats: [numFiles=1, numRows=1, totalSize=25, rawDataSize=24] Partition oct19.dyn_part{txn_date= 03-04-2015} stats: [numFiles=1, numRows=2, totalSize=50, rawDataSize=48] Partition oct19.dyn_part{txn_date=01-01-2015} stats: [numFiles=1, numRows=1, totalSize=26, rawDataSize=25] Partition oct19.dyn_part{txn_date=01-02-2015} stats: [numFiles=1, numRows=1, totalSize=26, rawDataSize=25] Partition oct19.dyn_part{txn_date=03-04-2015} stats: [numFiles=1, numRows=1, totalSize=26, rawDataSize=25] Partition oct19.dyn_part{txn_date=04-02-2015} stats: [numFiles=1, numRows=1, totalSize=25, rawDataSize=24] MapReduce Jobs Launched: Stage-Stage-1: Map: 1 Cumulative CPU: 4.03 sec HDFS Read: 4166 HDFS Write: 614 SUCCESS Total MapReduce CPU Time Spent: 4 seconds 30 msec&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2019 07:26:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/unable-to-create-unique-partitions-in-hive/m-p/278898#M208310</guid>
      <dc:creator>priyanka1_munja</dc:creator>
      <dc:date>2019-10-06T07:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: unable to create unique partitions in hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/unable-to-create-unique-partitions-in-hive/m-p/278913#M208321</link>
      <description>&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/18663"&gt;@priyanka1_munja&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Are you complaining that same partition appears multiple times? Did you notice the extra space before some of the partition keys? For example, "03-04-2015" vs " 03-04-2015"? I think that's the reason for the duplicates.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Eric</description>
      <pubDate>Sun, 06 Oct 2019 22:11:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/unable-to-create-unique-partitions-in-hive/m-p/278913#M208321</guid>
      <dc:creator>EricL</dc:creator>
      <dc:date>2019-10-06T22:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: unable to create unique partitions in hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/unable-to-create-unique-partitions-in-hive/m-p/279828#M208485</link>
      <description>&lt;P&gt;Yes i didn't notice that it has space. So i used trim for it.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 00:32:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/unable-to-create-unique-partitions-in-hive/m-p/279828#M208485</guid>
      <dc:creator>priyanka1_munja</dc:creator>
      <dc:date>2019-10-10T00:32:03Z</dc:date>
    </item>
  </channel>
</rss>

