<?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: Problems importing tables from SAP that have / characters in the table name in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Problems-importing-tables-from-SAP-that-have-characters-in/m-p/126125#M88862</link>
    <description>&lt;P&gt;
	I can confirm what 
	&lt;A rel="user" href="https://community.cloudera.com/users/7629/joshuapersinger.html" nodeid="7629"&gt;@Josh Persinger&lt;/A&gt; is saying. The only way to get tables with forward slashes ('/') (and actually colons too) in the tablename from SAP into hadoop hdfs/hive is by using the --query statement.&lt;/P&gt;&lt;P&gt;
	Some other things I found out when importing from SAP HANA:&lt;/P&gt;&lt;OL&gt;
	
&lt;LI&gt;a table name can be something like 'MSG\TABLENAME' or even worse: '[SCHEMA]::database.[TABLENAME]'. Just make sure you put the complete tablename between escaped double quotes:
&lt;P&gt;	eg: 
	&lt;STRONG&gt;\"/&lt;/STRONG&gt;SOMETING/TABLENAME&lt;STRONG&gt;\"&lt;/STRONG&gt; or &lt;STRONG&gt;\"&lt;/STRONG&gt;[SCHEMA]::database.[TABLENAME]&lt;STRONG&gt;\"&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;	
&lt;LI&gt;we needed to add there where clause '\$CONDITIONS' even though we did a select * without any filters.&lt;/LI&gt;	
&lt;LI&gt;when limiting the result with a where clause the values have to be between &lt;STRONG&gt;single quotes&lt;/STRONG&gt;:
&lt;P&gt;	eg. WHERE DDLANGUAGE='E'
	&lt;/P&gt;&lt;/LI&gt;	
&lt;LI&gt;SAP columns can contain empty values called SPACE (not the same as NULL) (shown as a '?' in the webIDE). If you want to exclude them use the where clause &amp;lt;&amp;gt;'' (just two singlequotes following each other):
&lt;P&gt;	WHERE DDLANGUAGE&amp;lt;&amp;gt;''
	&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;When making your command more readible I had to keep one extra parameter after the --query parameter. When I moved the --hive-import to the next line the command would fail (I think due to the ending quotes of the query.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;
	The result should look something like this:&lt;/P&gt;&lt;P&gt;
	sqoop import --connect "jdbc:sap://[SERVER]:30015&lt;STRONG&gt;/?currentschema=[SCHEMA]&lt;/STRONG&gt;" \ &lt;/P&gt;&lt;P&gt;--username [USERNAME] \ &lt;/P&gt;&lt;P&gt;--password-file file:///[PATH]/.pwd_file \ &lt;/P&gt;&lt;P&gt;--driver com.sap.db.jdbc.Driver \ &lt;/P&gt;&lt;P&gt;--query "select * from &lt;STRONG&gt;\"&lt;/STRONG&gt;[&lt;STRONG&gt;/&lt;/STRONG&gt;TABLENAME&lt;STRONG&gt;/&lt;/STRONG&gt;WITH&lt;STRONG&gt;/&lt;/STRONG&gt;FORWARDSLASHES]&lt;STRONG&gt;\"&lt;/STRONG&gt; &lt;STRONG&gt;WHERE &lt;/STRONG&gt;DDLANGUAGE&lt;STRONG&gt;='E'&lt;/STRONG&gt; and [COLUMNNAME]&lt;STRONG&gt;&amp;lt;&amp;gt;''&lt;/STRONG&gt; and &lt;STRONG&gt;\$CONDITIONS&lt;/STRONG&gt;" --hive-import \ &lt;/P&gt;&lt;P&gt;--hive-database [HIVEDATABASE] \ &lt;/P&gt;&lt;P&gt;--hive-table [TABLENAME] \ &lt;/P&gt;&lt;P&gt;--hive-delims-replacement ' ' \ &lt;/P&gt;&lt;P&gt;--fields-terminated-by '|' \ &lt;/P&gt;&lt;P&gt;--lines-terminated-by '\n' \ &lt;/P&gt;&lt;P&gt;--hive-overwrite 
--num-mappers 1&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2016 18:38:11 GMT</pubDate>
    <dc:creator>rene_sluiter</dc:creator>
    <dc:date>2016-07-08T18:38:11Z</dc:date>
  </channel>
</rss>

