<?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: Getting duplicate data when importing data to HDFS using sqoop in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133741#M34999</link>
    <description>&lt;P&gt;Typo in sqoop command use mysql driver instead of using Teradata driver.&lt;/P&gt;&lt;P&gt;Here is modified script:&lt;/P&gt;&lt;P&gt;sqoop import --connect jdbc:mysql://192.168.218.128/sqoopdb --driver com.mysql.jdbc.Driver --username hadoop --password Hadoop@1 --query "select * from emp_add where city='sec-bad' AND \$CONDITIONS" --target-dir /Practice/SqoopToHDFSWhere/ --m 1;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2016 01:48:58 GMT</pubDate>
    <dc:creator>divakarreddy_a</dc:creator>
    <dc:date>2016-07-20T01:48:58Z</dc:date>
    <item>
      <title>Getting duplicate data when importing data to HDFS using sqoop</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133737#M34995</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to import data from mysql to HDFS using sqoop:: The command is as below::&lt;/P&gt;&lt;P&gt;sqoop import --connect jdbc:mysql://192.168.218.128/sqoopdb -username hadoop --table EMP_ADD --driver com.mysql.jdbc.Driver --m 1 --where "CITY='sec-bad'" --target-dir /Practice/SqoopToHDFSWhere&lt;/P&gt;&lt;P&gt;Post checking the respective generated files in HDFS, getting the data duplicated.&lt;/P&gt;&lt;P&gt;[hdfs@sandbox root]$ hadoop fs -cat /Practice/SqoopToHDFSWhere/part-m-00000 &lt;/P&gt;&lt;P&gt;1202,108I,aoc,sec-bad &lt;/P&gt;&lt;P&gt;1204,78B,old city,sec-bad &lt;/P&gt;&lt;P&gt;1205,720X,hitec,sec-bad &lt;/P&gt;&lt;P&gt;1202,108I,aoc,sec-bad &lt;/P&gt;&lt;P&gt;1204,78B,old city,sec-bad &lt;/P&gt;&lt;P&gt;1205,720X,hitec,sec-bad&lt;/P&gt;&lt;P&gt;Please help me on this.. &lt;/P&gt;&lt;P&gt;PS:- I am using HDP2.4&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suresh Kumar&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 00:52:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133737#M34995</guid>
      <dc:creator>sureshkumardv</dc:creator>
      <dc:date>2016-07-19T00:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Getting duplicate data when importing data to HDFS using sqoop</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133738#M34996</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11919/sureshkumardv.html" nodeid="11919"&gt;@Suresh Kumar D&lt;/A&gt;&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;sqoop import --connect jdbc:mysql://192.168.218.128/sqoopdb --driver "com.teradata.jdbc.TeraDriver" --username hadoop --password Hadoop@1 --query "select * from emp_add where city='sec-bad' AND \$CONDITIONS" --target-dir /Practice/SqoopToHDFSWhere/ --m 1;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 01:14:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133738#M34996</guid>
      <dc:creator>divakarreddy_a</dc:creator>
      <dc:date>2016-07-19T01:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Getting duplicate data when importing data to HDFS using sqoop</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133739#M34997</link>
      <description>&lt;P&gt;Hi Divakar,&lt;/P&gt;&lt;P&gt;When I tried above getting a new error::&lt;/P&gt;&lt;P&gt;16/07/19 07:22:58 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.teradata.jdbc.TeraDriver
java.lang.RuntimeException: Could not load db driver class: com.teradata.jdbc.TeraDriver
        at org.apache.sqoop.manager.SqlManager.makeConnection(SqlManager.java:856)
        at org.apache.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:52)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:744)
        at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:767)
        at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:270)
        at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241).....&lt;/P&gt;&lt;P&gt;I just want to know, whenever I run command once, data is getting inserted twice. any settings/configurations needs to be changed.&lt;/P&gt;&lt;P&gt;PFA&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/5848-sqoopduplication.jpg"&gt;sqoopduplication.jpg&lt;/A&gt; complete execution output::&lt;/P&gt;&lt;P&gt;as per MapReduce output it is retrieving 6 records. Please suggest.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 14:32:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133739#M34997</guid>
      <dc:creator>sureshkumardv</dc:creator>
      <dc:date>2016-07-19T14:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Getting duplicate data when importing data to HDFS using sqoop</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133740#M34998</link>
      <description>&lt;P&gt;Can you confirm if your mysql query is not resulting duplicates i.e. "select * from emp_add where city='sec-bad'"&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 18:16:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133740#M34998</guid>
      <dc:creator>praveenesh_kuma</dc:creator>
      <dc:date>2016-07-19T18:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Getting duplicate data when importing data to HDFS using sqoop</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133741#M34999</link>
      <description>&lt;P&gt;Typo in sqoop command use mysql driver instead of using Teradata driver.&lt;/P&gt;&lt;P&gt;Here is modified script:&lt;/P&gt;&lt;P&gt;sqoop import --connect jdbc:mysql://192.168.218.128/sqoopdb --driver com.mysql.jdbc.Driver --username hadoop --password Hadoop@1 --query "select * from emp_add where city='sec-bad' AND \$CONDITIONS" --target-dir /Practice/SqoopToHDFSWhere/ --m 1;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 01:48:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Getting-duplicate-data-when-importing-data-to-HDFS-using/m-p/133741#M34999</guid>
      <dc:creator>divakarreddy_a</dc:creator>
      <dc:date>2016-07-20T01:48:58Z</dc:date>
    </item>
  </channel>
</rss>

