<?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 In sqoop import command i need  to write query on last-value  modified  time-stamp i need to load records before last-value ts and after last-value time stamp and in between how to write a query ??? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/In-sqoop-import-command-i-need-to-write-query-on-last-value/m-p/116006#M46937</link>
    <description>&lt;P&gt;1)sqoop import --connect jdbc:mysql://xxx.xxx.x.xxx/seema --driver com.mysql.jdbc.Driver --username hadoop --password big_data --table st  --hive-import  --hive-table st  -m 1  --incremental lastmodified --check-column ts --last-value '2016-11-21 10:38:12' -m 1 --merge-key id&lt;/P&gt;&lt;P&gt;this 1) query working&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2)sqoop import --connect jdbc:mysql://192.168.1.254/saleema --driver com.mysql.jdbc.Driver --username big_data --password big_data --table st  --hive-import  --hive-table st -m 1  --incremental lastmodified --check-column ts --last-value ' &amp;gt;= 2016-11-21 10:38:12' -m 1 --merge-key id
&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3)sqoop import --connect jdbc:mysql://192.168.1.254/saleema --driver com.mysql.jdbc.Driver --username big_data --password big_data --table st --hive-import --hive-table st -m 1 --incremental lastmodified --check-column ts --last-value ' &amp;lt;= 2016-11-21 10:38:12' -m 1 --merge-key id&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2 &amp;amp; 3 is not working &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;how to execute this query&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;please suggest me&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;thanks in advance&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;swathi.T&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2016 15:12:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-11-22T15:12:52Z</dc:date>
    <item>
      <title>In sqoop import command i need  to write query on last-value  modified  time-stamp i need to load records before last-value ts and after last-value time stamp and in between how to write a query ???</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/In-sqoop-import-command-i-need-to-write-query-on-last-value/m-p/116006#M46937</link>
      <description>&lt;P&gt;1)sqoop import --connect jdbc:mysql://xxx.xxx.x.xxx/seema --driver com.mysql.jdbc.Driver --username hadoop --password big_data --table st  --hive-import  --hive-table st  -m 1  --incremental lastmodified --check-column ts --last-value '2016-11-21 10:38:12' -m 1 --merge-key id&lt;/P&gt;&lt;P&gt;this 1) query working&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2)sqoop import --connect jdbc:mysql://192.168.1.254/saleema --driver com.mysql.jdbc.Driver --username big_data --password big_data --table st  --hive-import  --hive-table st -m 1  --incremental lastmodified --check-column ts --last-value ' &amp;gt;= 2016-11-21 10:38:12' -m 1 --merge-key id
&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3)sqoop import --connect jdbc:mysql://192.168.1.254/saleema --driver com.mysql.jdbc.Driver --username big_data --password big_data --table st --hive-import --hive-table st -m 1 --incremental lastmodified --check-column ts --last-value ' &amp;lt;= 2016-11-21 10:38:12' -m 1 --merge-key id&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2 &amp;amp; 3 is not working &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;how to execute this query&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;please suggest me&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;thanks in advance&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;swathi.T&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 15:12:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/In-sqoop-import-command-i-need-to-write-query-on-last-value/m-p/116006#M46937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-22T15:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: In sqoop import command i need  to write query on last-value  modified  time-stamp i need to load records before last-value ts and after last-value time stamp and in between how to write a query ???</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/In-sqoop-import-command-i-need-to-write-query-on-last-value/m-p/116007#M46938</link>
      <description>&lt;P&gt;Instead of using the "-incremental" approach, you could use the "--query" or "--where" and bake in your own incremental logic.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 22:43:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/In-sqoop-import-command-i-need-to-write-query-on-last-value/m-p/116007#M46938</guid>
      <dc:creator>clukasik</dc:creator>
      <dc:date>2017-01-05T22:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: In sqoop import command i need  to write query on last-value  modified  time-stamp i need to load records before last-value ts and after last-value time stamp and in between how to write a query ???</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/In-sqoop-import-command-i-need-to-write-query-on-last-value/m-p/116008#M46939</link>
      <description>&lt;P&gt;thanks clukasik,&lt;/P&gt;&lt;P&gt;i solved  and executed with where and query approach &lt;/P&gt;&lt;P&gt;Eg:  sqoop  import --connect $connectors//$origServer/$origDatabase  --driver $drivers --username $username --password $password  --query "select a.* from $origTable a where CAST(ts as DATE)&amp;gt;='$startdate' and  CAST(ts as DATE)&amp;lt;='$enddate'  AND \$CONDITIONS"  --hive-import --hive-database $hiveDatabase  --hive-table $myTable -m 1 --fields-terminated-by '\t'  --incremental lastmodified --check-column ts --merge-key id --target-dir $targetTmpHdfsDir/$myTable&lt;/P&gt;&lt;P&gt;thanks with regards,&lt;/P&gt;&lt;P&gt;swathi.T&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2017 02:47:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/In-sqoop-import-command-i-need-to-write-query-on-last-value/m-p/116008#M46939</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-01-06T02:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: In sqoop import command i need  to write query on last-value  modified  time-stamp i need to load records before last-value ts and after last-value time stamp and in between how to write a query ???</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/In-sqoop-import-command-i-need-to-write-query-on-last-value/m-p/116009#M46940</link>
      <description>&lt;P&gt;Hi - could you share your entire UNIX script that using sqoop Statement..&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 23:16:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/In-sqoop-import-command-i-need-to-write-query-on-last-value/m-p/116009#M46940</guid>
      <dc:creator>Srinivas_Kadaka</dc:creator>
      <dc:date>2017-03-14T23:16:46Z</dc:date>
    </item>
  </channel>
</rss>

