简体   繁体   中英

Import table from Windows SQL Server 2012 to hadoop using sqoop

I was trying to import a table from RDBMS (Windows - SQL Server 2012) to HDFS using the code below. But I'm getting an error. I could successfully connect it.

sqoop import   
--connect      
"jdbc:sqlserver://192.1x8.xx.1:14xx;database=AdventureWorks2012;
 username=hadox;password=hadxx" 
 --table Production.Product
     --hive-import  

I understood the error was caused by the dot (.) in the tables name.

I got that information from the link sqoop to import data to hive . I didn't understand any details in that link.

Can anyone help please?

Thanks in advance.

Error:

ERROR manager.SqlManager: Error executing statement com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'Production.Product'.
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'Production.Product'.

Internally sqoop will consider Production as schemaname (database name) Product as the table name. if you want to use import the table into production database, product table in hive. I would suggest you to use --query in sqoop command using that you are specifying the sqoop to look for specific table.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM