We have an MSSQL DB set-up with column names of "Column 0" and "Column 1": note the space.
If I run the following command, it errors:
sqoop import --driver net.sourceforge.jtds.jdbc.Driver --connect jdbc:jtds:sqlserver://somemssqldb.com/OurDB --table dbo.OurTableName --username username --password ourPassword --columns "Column 0" --target-dir s3://our-s3-bucket/9/data/1262/141893327230246 -m 1
Stack trace reports:
Error: java.io.IOException: SQLException in nextKeyValue Caused by: java.sql.SQLException: Incorrect syntax near '0'.
If we remove the column name spaces in the DB as well as in the command, it works.
How can we get it to support using spaces in the --columns argument? The only way we are successfully able to do so if by using --query specifically and escape.
For example we have to write a query like this:
SELECT t.[Column 1]
--columns '`Column 0`'? - Elliott Frisch