<?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 Sqoop import - special characters in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/54227#M60139</link>
    <description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;Working on importing data from DB2 using sqoop import, it worked fine for the most part except one table, which seemed to have some special characters ( control-M = ^M ) in contents, hence while sqooping, these characters are treated as newline and hence everything after it will be on the next line in the imported files, which will affect all the records after one bad record.&lt;/P&gt;&lt;P&gt;I am unable to guess how to fix the imports? is there any easy way?&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 11:31:38 GMT</pubDate>
    <dc:creator>Freakabhi</dc:creator>
    <dc:date>2022-09-16T11:31:38Z</dc:date>
    <item>
      <title>Sqoop import - special characters</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/54227#M60139</link>
      <description>&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;Working on importing data from DB2 using sqoop import, it worked fine for the most part except one table, which seemed to have some special characters ( control-M = ^M ) in contents, hence while sqooping, these characters are treated as newline and hence everything after it will be on the next line in the imported files, which will affect all the records after one bad record.&lt;/P&gt;&lt;P&gt;I am unable to guess how to fix the imports? is there any easy way?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 11:31:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/54227#M60139</guid>
      <dc:creator>Freakabhi</dc:creator>
      <dc:date>2022-09-16T11:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop import - special characters</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/54237#M60140</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/21351"&gt;@Freakabhi&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your business allows to replace Ctrl+M with something else then&amp;nbsp;I would suggest two steps&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Understand the regexp_replace function&lt;/P&gt;&lt;P&gt;ex:&amp;nbsp;regexp_replace(col2, &amp;nbsp;'&amp;lt;the char that you want to replce&amp;gt;', '')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Use --query option instead of --table option in sqoop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you have to use the following method to replace Ctrl+M with something else in your sqoop script&lt;/P&gt;&lt;P&gt;--query "select col1, regexp_replace(col2, &amp;nbsp;'&amp;lt;the char that you want to replce&amp;gt;', '') from db.table"&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 14:59:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/54237#M60140</guid>
      <dc:creator>saranvisa</dc:creator>
      <dc:date>2017-04-28T14:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop import - special characters</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/60224#M60141</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/18441"&gt;@saranvisa&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/21351"&gt;@Freakabhi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the same with Teradata but it throws an error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Teradata Database] [TeraJDBC 15.10.00.26] [Error 6706] [SQLState HY000] The string contains an untranslatable character.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did i add the parameter right ?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PFB my sqoop command&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;sqoop import --connect jdbc:teradata://xx.xx.xx/DATABASE=xxx --username xxx -P --query "SELECT TOP 1000 regexp_replace(load_hash_key_val,'^M',''),regexp_replace(load_hash_data_val,'^M','') FROM db.tble_name  where 1=1 AND \$CONDITIONS" --target-dir /hadoop/test -m1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions please ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 12:24:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/60224#M60141</guid>
      <dc:creator>tkrish03</dc:creator>
      <dc:date>2017-09-22T12:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop import - special characters</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/269171#M60142</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you let me know how to replace a set of special characters in the sqoop import query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to replace the column value if it contains any of the special characters(|,",^,$,% etc) in it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 12:50:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/269171#M60142</guid>
      <dc:creator>Vijay687</dc:creator>
      <dc:date>2019-08-28T12:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sqoop import - special characters</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/380758#M60143</link>
      <description>&lt;P&gt;use&amp;nbsp;--hive-drop-import-delims |tr -d '\r'&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 08:12:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Sqoop-import-special-characters/m-p/380758#M60143</guid>
      <dc:creator>edmp</dc:creator>
      <dc:date>2023-12-13T08:12:22Z</dc:date>
    </item>
  </channel>
</rss>

