<?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: sqoop insert into partitioned table​ in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118286#M81069</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1662/parinitakothari.html" nodeid="1662"&gt;@Parinita Kothari&lt;/A&gt; Yes you can do that too..&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Create a Hive paritioned table and set hive.exec.dynamic.partition.mode=nonstrict in a case of dynamic&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;    -Import table from DB to the partitioned table
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;here you need not specificy partition-keys and partition-values , Just -table &amp;lt;tblname&amp;gt; --hcatalog-table &amp;lt;tblname&amp;gt; is enough..&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2016 13:55:45 GMT</pubDate>
    <dc:creator>dchiguruvad</dc:creator>
    <dc:date>2016-07-11T13:55:45Z</dc:date>
    <item>
      <title>sqoop insert into partitioned table​</title>
      <link>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118283#M81066</link>
      <description>&lt;P&gt;Hi, I am looking to run 2 sqoop command&lt;/P&gt;&lt;P&gt;1. To pull the entire content of a table and insert into an Hive partitioned table using sqoop&lt;/P&gt;&lt;PRE&gt;sqoop import --connect jdbc:oracle:thin:@//jfadboc1.jfa.unibet.com:1521/xxx --username xxx --password xxx --table DW_FACT_PUNTER_TEMP --split-by TIME_KEY --target-dir unica/data/DW_FACT_PUNTER_TEST  --hive-import --hive-overwrite --hive-drop-import-delims --null-non-string '\\N' --null-string '\\N' --hive-table unica.DW_FACT_PUNTER_TEST_TEMP --hive-partition-key "TIME_YEAR", "TIME_MONTH","TIME_DAY"  
&lt;/PRE&gt;&lt;P&gt;2. Do incremental load in sqoop and insert into the partitioned table&lt;/P&gt;&lt;PRE&gt;sqoop import --connect jdbc:oracle:thin:@//jfadboc1.jfa.unibet.com:1521/xxx --username &lt;/PRE&gt;&lt;P&gt;xxx --password xxx --query "SELECT TIME_KEY,PUNTER_KEY,PRODUCT_KEY,INDICATOR_KEY,INDICATOR_VALUE,INSERT_TIME FROM DW_FACT_PUNTER_TEST WHERE \$CONDITIONS AND (TIME_KEY &amp;gt;=20010101)" --split-by TIME_KEY --target-dir unica/data/FACT_PUNTER_IUD_UNICA_INCR  --hive-import --hive-overwrite --hive-drop-import-delims --null-non-string '\\N' --null-string '\\N' --hive-table unica.DW_FACT_PUNTER_TEST_TEMP --hive-partition-key "TIME_YEAR"  &lt;/P&gt;
&lt;P&gt;My table structure is below&lt;/P&gt;&lt;PRE&gt;CREATE TABLE IF NOT EXISTS DW_FACT_PUNTER_TEST_TEMP
(PUNTER_KEY DECIMAL(36,2), 
PRODUCT_KEY DECIMAL(36,2), 
INDICATOR_KEY DECIMAL(36,2), 
INDICATOR_VALUE DECIMAL(36,2), 
INSERT_TIME STRING) 
PARTITIONED BY(TIME_YEAR STRING, TIME_MONTH STRING,TIME_DAY STRING);
&lt;/PRE&gt;&lt;P&gt;Both these sqoop commands are not working.&lt;/P&gt;&lt;P&gt;Can you please help me understand how I can use --hive-partition-key for mass import and where there are more than 1 columns used to partition a table.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 23:26:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118283#M81066</guid>
      <dc:creator>parinita</dc:creator>
      <dc:date>2016-07-07T23:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: sqoop insert into partitioned table​</title>
      <link>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118284#M81067</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1662/parinitakothari.html" nodeid="1662"&gt;@Parinita Kothari&lt;/A&gt; To import into Multi-key partitioned Hive table , you can make use of --hcatalog-table&lt;/P&gt;&lt;P&gt;-table &amp;lt;tblname&amp;gt; --hcatalog-table  &amp;lt;tblname&amp;gt; --hcatalog-partition-keys k1,k2  --hcatalog-partition-values 'v1,v2'&lt;/P&gt;&lt;P&gt;eg: -table DW_FACT_PUNTER_TEST_TEMP --hcatalog-table DW_FACT_PUNTER_TEST_TEMP --hcatalog-partition-keys  TIME_YEAR,TIME_MONTH --hcatalog-partition-values '2014-04-11,2014-APR'&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 03:44:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118284#M81067</guid>
      <dc:creator>dchiguruvad</dc:creator>
      <dc:date>2016-07-08T03:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: sqoop insert into partitioned table​</title>
      <link>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118285#M81068</link>
      <description>&lt;P&gt;Thank you &lt;A rel="user" href="https://community.cloudera.com/users/5354/dchiguruvada.html" nodeid="5354"&gt;@Dileep Kumar Chiguruvada&lt;/A&gt; for your quick response.&lt;/P&gt;&lt;P&gt;Is it neccessary that I need to hardcode the value for --hcatalog-partition-values?&lt;/P&gt;&lt;P&gt;The table I am pulling data from (in oracle) has data since 2001-01-01 and it could be nice to be able to use dynamic partitions here.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 16:20:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118285#M81068</guid>
      <dc:creator>parinita</dc:creator>
      <dc:date>2016-07-08T16:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: sqoop insert into partitioned table​</title>
      <link>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118286#M81069</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1662/parinitakothari.html" nodeid="1662"&gt;@Parinita Kothari&lt;/A&gt; Yes you can do that too..&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Create a Hive paritioned table and set hive.exec.dynamic.partition.mode=nonstrict in a case of dynamic&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;    -Import table from DB to the partitioned table
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;here you need not specificy partition-keys and partition-values , Just -table &amp;lt;tblname&amp;gt; --hcatalog-table &amp;lt;tblname&amp;gt; is enough..&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 13:55:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118286#M81069</guid>
      <dc:creator>dchiguruvad</dc:creator>
      <dc:date>2016-07-11T13:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: sqoop insert into partitioned table​</title>
      <link>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118287#M81070</link>
      <description>&lt;P&gt;Thank you &lt;A rel="user" href="https://community.cloudera.com/users/5354/dchiguruvada.html" nodeid="5354"&gt;@Dileep Kumar Chiguruvada&lt;/A&gt; it works now. I had to use sqoop and import the contents into a temp table ( which wasn't partitioned) and after use this temp table to insert into the actual partitioned tables. Couldn't really find a direct way to ingest data directly into a partitioned table which has more than 1 columns which are partitioned using sqoop.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2016 17:25:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/sqoop-insert-into-partitioned-table/m-p/118287#M81070</guid>
      <dc:creator>parinita</dc:creator>
      <dc:date>2016-07-13T17:25:51Z</dc:date>
    </item>
  </channel>
</rss>

