问题
Trying to import data from SAP Hana using table that contains a forward slash '/'. Not sure if escaping the '/' will work.
My connection attempt:
sqoop import –connect jdbc:sap://mysaphost:30015 --driver com.sap.db.jdbc.Driver --username xxxxxx --password xxxx --table xxx./xxx/xxx
Produces the following error:
2016-05-20 13:12:23,098 ERROR - [main:] ~ Error executing statement: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "/": line 1 col 24 (at pos 24) (SqlManager:43) com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "/": line 1 col 24 (at pos 24)
回答1:
In order to use object names with slashes (or other special characters) you need to enclose them into double quotation marks (").
As you seem to use a command line interface and want to pass the table name as an argument, you most likely have to escape those quotation.
Try something like
sqoop import –connect jdbc:sap://mysaphost:30015 --driver com.sap.db.jdbc.Driver
--username xxxxxx --password xxxx --table \"xxx./xxx/xxx\"
(still just one line!) and see how that goes.
回答2:
Not sure, But maybe you can just try to enclose table name with double quotations (")
sqoop import –connect jdbc:sap://mysaphost:30015 --driver com.sap.db.jdbc.Driver --username xxxxxx --password xxxx --table xxx."/xxx/xxx"
回答3:
Can you try something like --table "XXX".\" XYZ\"
回答4:
Updated to latest version of JDBC driver for SAP Hana.
来源:https://stackoverflow.com/questions/37356777/using-sqoop1-with-sap-hana-using-a-table-name-that-contains-forward-slash-ca