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.

SQOOP --query with SCHEMA in MSSQL

Solved Go to solution

SQOOP --query with SCHEMA in MSSQL

New Contributor

I'm trying to use the --query option in sqoop to import data from MSSQL. My concern is, how can we declare which schema to use ung --query in MSSQL.

 

My script:

sqoop \
--options-file sqoop/aw_mssql.cfg \
--query "select BusinessEntityId, LoginID, cast(OrganizationNode as string) from Employee where \$CONDITIONS" \
--hive-table employees \
--hive-database mssql \
-- --schema=HumanResources

 

Still produces an error "Invalid object name 'Employee'".

 

Also tried --connect "jdbc:sqlserver://192.168.1.17;database=AdventureWorks;schema=HumanResources" but also failed.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: SQOOP --query with SCHEMA in MSSQL

Champion

@helpdk

 

Have you tried this?

 

select col1, col2 from HumanResources.Employee

2 REPLIES 2

Re: SQOOP --query with SCHEMA in MSSQL

Champion

@helpdk

 

Have you tried this?

 

select col1, col2 from HumanResources.Employee

Highlighted

Re: SQOOP --query with SCHEMA in MSSQL

New Contributor
My bad, that was the only thing i didn't try lol. BTW, this is the solution. Thanks
Don't have an account?
Coming from Hortonworks? Activate your account here