<?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 import fails and  shows in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/sqoop-import-fails-and-shows/m-p/282670#M210119</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/70322"&gt;@Rak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have a couple of errors in your sqoop syntax but you are almost there, please have a look at the below hints and retry after understanding and correcting them.&lt;/P&gt;&lt;P&gt;1. Sqoop &lt;STRONG&gt;import--connect&lt;/STRONG&gt; This is wrong you need a space between the import and -- ie &lt;FONT color="#FF6600"&gt;sqoop import --connect&lt;/FONT&gt;&lt;BR /&gt;2. &lt;STRONG&gt;'jdbc:sqlserver'--username&lt;/STRONG&gt; is also not correct you need a port number and databases name ie &lt;FONT color="#FF6600"&gt;"jdbc:sqlserver://&amp;lt;Server_Host&amp;gt;:&amp;lt;Server_Port&amp;gt;;databaseName"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;3. The quotes around the&amp;nbsp;&lt;STRONG&gt;'2019-11-08'" &lt;/STRONG&gt;is wrong too&lt;BR /&gt;3. All you &lt;STRONG&gt;--&lt;/STRONG&gt; should have a space before&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sqoop import--connect 'jdbc:sqlserver'--username 'sa' -P--query "select * from dlyprice where $CONDITIONS AND `date`= '2019-11-08'"--split-by `date--target-dir /home/hduser2 -m 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try something like this !&lt;/P&gt;&lt;P&gt;&lt;FONT size="2" color="#FF6600"&gt;sqoop import --connect --connect "jdbc:sqlserver://&amp;lt;Server_Host&amp;gt;:&amp;lt;Server_Port&amp;gt;;DB_Name&amp;gt;" \&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#FF6600"&gt;--driver com.microsoft.sqlserver.jdbc.SQLServerDriver \&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#FF6600"&gt;--username XXXX -P --query "select * from dlyprice&amp;nbsp; where $CONDITIONS AND `date`= '2019-11-08' \&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2" color="#FF6600"&gt;--split-by `date`&amp;nbsp; --target-dir /home/hduser2 -m 2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above isn't tested by I wanted to highlight some of your mistakes by making it work makes you a better hadooper !&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a link to &lt;A href="https://sqoop.apache.org/docs/1.4.1-incubating/SqoopUserGuide.html#_connecting_to_a_database_server" target="_blank" rel="noopener"&gt;Sqoop User Guide&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try out this syntax remember to replace the values with that&amp;nbsp; of your environment&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sqoop import --connect "jdbc:sqlserver://hostname;username='sa';password='sa_password';database=yourDB" --driver com.microsoft.sqlserver.jdbc.SQLServerDriver --query "select * from dlyprice where \$CONDITIONS" --split-by date -m 2 --target-dir /home/hduser2 &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please revert&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2019 20:22:00 GMT</pubDate>
    <dc:creator>Shelton</dc:creator>
    <dc:date>2019-11-11T20:22:00Z</dc:date>
  </channel>
</rss>

