<?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 Incremental scenairo in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107339#M21698</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/3170/saivaran.html" nodeid="3170"&gt;@saichand varanasi&lt;/A&gt;&lt;P&gt; For next run, you need to modify last-value to last-value returned from first run. See &lt;A href="https://sqoop.apache.org/docs/1.4.0-incubating/SqoopUserGuide.html#id1764421" target="_blank"&gt;https://sqoop.apache.org/docs/1.4.0-incubating/SqoopUserGuide.html#id1764421&lt;/A&gt; section 7.2.7 on how to do incremental imports. You can use a sqoop job or Oozie that can automate this process.  &lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2016 09:22:50 GMT</pubDate>
    <dc:creator>shishir_saxena4</dc:creator>
    <dc:date>2016-03-03T09:22:50Z</dc:date>
    <item>
      <title>Sqoop Incremental scenairo</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107338#M21697</link>
      <description>&lt;P&gt;Hi, I have table Service Requests (SRs) which is having 10k records as of today trying to implement incremental logic so that when i run tomorrow need to capture only newly inserted and updated records&lt;/P&gt;&lt;P&gt;&lt;B&gt;Table structure &lt;/B&gt;: row_id (unique), SR# , Sr_owner,sr_group,sr_last_update_date (timestamp) &lt;/P&gt;&lt;P&gt;&lt;B&gt;Approache :&lt;/B&gt;&lt;/P&gt;&lt;P&gt;1) created sqoop job as below&lt;/P&gt;&lt;PRE&gt;sqoop job --create sr_table -- import --connect "jdbc:sqlserver://localhost:1431;database=test;username=root;password=welcome1" --query 'select * from  sr_table where $CONDITIONS' --target-dir /data/sr/sr_table --append --check-column SR_LAST_UPD --incremental lastmodified --last-value '1900-01-01' --split-by ROW_ID&lt;/PRE&gt;&lt;P&gt;2) While running this for the first time its working fine (Full data or full load)&lt;/P&gt;&lt;P&gt;3) If I re-execute it again its not comparing he Upper Bound value with last run time (SR_LAST_UPD)&lt;/P&gt;&lt;P&gt;Was able to follow this (https://github.com/abajwa-hw/single-view-demo/blob/master/singleview-mysql-advanced-23.md)&lt;/P&gt;&lt;P&gt;I'm looking for more dynamic way of &lt;STRONG&gt;comparing the sqoop job execution time to compare with sr_last_upd value&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;Thanks -&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 05:07:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107338#M21697</guid>
      <dc:creator>saivaran</dc:creator>
      <dc:date>2016-03-03T05:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop Incremental scenairo</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107339#M21698</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/3170/saivaran.html" nodeid="3170"&gt;@saichand varanasi&lt;/A&gt;&lt;P&gt; For next run, you need to modify last-value to last-value returned from first run. See &lt;A href="https://sqoop.apache.org/docs/1.4.0-incubating/SqoopUserGuide.html#id1764421" target="_blank"&gt;https://sqoop.apache.org/docs/1.4.0-incubating/SqoopUserGuide.html#id1764421&lt;/A&gt; section 7.2.7 on how to do incremental imports. You can use a sqoop job or Oozie that can automate this process.  &lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 09:22:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107339#M21698</guid>
      <dc:creator>shishir_saxena4</dc:creator>
      <dc:date>2016-03-03T09:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop Incremental scenairo</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107340#M21699</link>
      <description>&lt;P&gt;@Shishir , Thanks for your reply ...&lt;/P&gt;&lt;P&gt;1) Saving the job with 1900-01-01 (first time)&lt;/P&gt;&lt;P&gt;2) Save the same job with &lt;STRONG&gt;last-value  &lt;/STRONG&gt;should solve the problem (modifying same job)?&lt;/P&gt;&lt;PRE&gt;sqoop job --create sr_table --import--connect "jdbc:sqlserver://localhost:1431;database=test;username=root;password=welcome1"--query 'select * from  sr_table where $CONDITIONS'--target-dir /data/sr/sr_table --append --check-column SR_LAST_UPD --incremental lastmodified --last-value  last-value --split-by ROW_ID&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Mar 2016 09:26:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107340#M21699</guid>
      <dc:creator>saivaran</dc:creator>
      <dc:date>2016-03-03T09:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop Incremental scenairo</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107341#M21700</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/3170/saivaran.html" nodeid="3170"&gt;@saichand varanasi&lt;/A&gt;, Sqoop incremental import works either in the append mode or in the lastmodified mode, but you have specified both on your command line. Check &lt;A href="https://sqoop.apache.org/docs/1.4.6/SqoopUserGuide.html#_incremental_imports"&gt;here&lt;/A&gt; for command specs, and &lt;A href="https://community.hortonworks.com/questions/10710/sqoop-incremental-import-working-fine-now-i-want-k.html"&gt;here&lt;/A&gt; for a lastomodified Sqoop job sample. Sqoop job will keep track of the "last-value" for you, no need to do that manually.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 10:22:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107341#M21700</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2016-03-03T10:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop Incremental scenairo</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107342#M21701</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/2820/shishirsaxena3.html" nodeid="2820"&gt;@Shishir Saxena&lt;/A&gt; and &lt;A rel="user" href="https://community.cloudera.com/users/177/pminovic.html" nodeid="177"&gt;@Predrag Minovic&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/177/pminovic.html" nodeid="177"&gt;@Predrag Minovic&lt;/A&gt; Thank you but if I don't use any append or merge-key its throwing error as below&lt;/P&gt;&lt;P&gt;With the below job definition sqoop is able to pick the date dynamically  hopefully this should not be a problem?&lt;/P&gt;&lt;PRE&gt;ERROR tool.ImportTool: Error during import: -&lt;STRONG&gt;-merge-key or --append&lt;/STRONG&gt; is required when using --incremental lastmodified and the output directory exists.&lt;/PRE&gt;&lt;PRE&gt;sqoop job --create SRs-- import --connect "jdbc:sqlserver://localhost:1431;database=xx;username=root;password=welcome1" --query 'select * from  sr_table where $CONDITIONS' --target-dir /data/sr/sr_table --append --check-column LAST_UPD --incremental lastmodified --last-value '2016-03-03 15:56:47.92' --split-by ROW_ID
&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Mar 2016 00:59:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-Incremental-scenairo/m-p/107342#M21701</guid>
      <dc:creator>saivaran</dc:creator>
      <dc:date>2016-03-04T00:59:08Z</dc:date>
    </item>
  </channel>
</rss>

