New Contributor
Posts: 3
Registered: ‎04-20-2017

SQOOP --query with SCHEMA in MSSQL

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://;database=AdventureWorks;schema=HumanResources" but also failed.

Posts: 228
Topics: 11
Kudos: 32
Solutions: 20
Registered: ‎09-02-2016

Re: SQOOP --query with SCHEMA in MSSQL



Have you tried this?


select col1, col2 from HumanResources.Employee

New Solutions