Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Problems importing tables from SAP that have / characters in the table name

Highlighted

Problems importing tables from SAP that have / characters in the table name

Contributor

Is there a way to make sqoop accept / characters in table and field names?

I have tried the following:

leaving the name as-is: --table /BI0/TCUSTOMER

wrapping in quotes: --table "/BI0/TCUSTOMER"

escaping each /: --table "\/BI0\/TCUSTOMER"

It produces this error each time for all three options above:

com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "\": line 1 col 17 (at pos 17)

16 REPLIES 16
Highlighted

Re: Problems importing tables from SAP that have / characters in the table name

Have you tried using --query using a specific select statement to pull data?

Highlighted

Re: Problems importing tables from SAP that have / characters in the table name

Contributor

So I found that if i force a query using --query it will work, but if I let sqoop generate the query it does not.

Example --query "select * from \"BI0/TCUSTOMER\"" will work, but referring to the table in the same way by using the --table \"BI0/TCUSTOMER\" argument does not work. So the problem must be when sqoop generates the SQL query on its own, it is not syntactically correct.

If there was a way to see the query it was generating that would be very helpful to troubleshoot it, but as far as I know there is not.

Highlighted

Re: Problems importing tables from SAP that have / characters in the table name

Contributor

Yes, doing that gave the same error.

Highlighted

Re: Problems importing tables from SAP that have / characters in the table name

@Josh Persinger

Please use like this, it will resolve the issue.

--table "TestSchema\".\"/BIC/AZDSOV1_100"

Similar to bug https://issues.apache.org/jira/browse/SQOOP-1722

Highlighted

Re: Problems importing tables from SAP that have / characters in the table name

I still believe this can be fix through different syntax since I don't have SAP installed with SAP driver so can't test it with multiple changes locally.

Please give another try with below syntax.

"SCHEMA.\"/BI0/TCUSTOMER\""

Highlighted

Re: Problems importing tables from SAP that have / characters in the table name

Did you tried the last suggested syntax or are you able to resolve this issue?

Re: Problems importing tables from SAP that have / characters in the table name

Contributor

Yes I tried the above. That somewhat fixed my problem, it seems to accept the syntax now, but I believe it is now literally interpreting the quotes as part of the table name, so when it goes to SAP to find that table, it can't find it because the quotes aren't actually there in the SAP table name...

16/06/08 15:10:31 ERROR tool.ImportTool: Encountered IOException running import job: java.io.FileNotFoundException: /tmp/sqoop-hdfs/compile/d26f755016cd4c734711de4a2550ca46/SCHEMA."/BI0/TCUSTOMER".jar (No such file or directory)

Highlighted

Re: Problems importing tables from SAP that have / characters in the table name

Ok then we may need to remove the initial double quote.

SCHEMA.\"/BI0/TCUSTOMER\"

Highlighted

Re: Problems importing tables from SAP that have / characters in the table name

Contributor

Got the same error:

16/06/08 16:20:49 ERROR tool.ImportTool: Encountered IOException running import job: java.io.FileNotFoundException: /tmp/sqoop-hdfs/compile/2fb644a9751cabd5c187540154e2e696/SAPR3."/BI0/TCUSTOMER".jar (No such file or directory)

Don't have an account?
Coming from Hortonworks? Activate your account here