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 import data using stored procedure

Solved Go to solution
Highlighted

Sqoop import data using stored procedure

Contributor
Hi,
 
I have a Stored Procedure (that runs a select query ) to import data from a DB2 database
 
How can I use it in sqoop?
I'm using the version 1.4.4-cdh5.0.2 of sqoop
 
 
I have tried to launch this command:
 
sqoop import --verbose --connect jdbc:db2://hostname:5300/db --username username --password password  --call NameStoredProcedure -m 1 --target-dir /tmp/DeltaY0/

 

 
But this doesn't work !!!
 
Have you any idea ? How can I solve it ?
 
Thanks
Alessio
 
 
 
 
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Sqoop import data using stored procedure

Expert Contributor
Stored procedures are an export only feature. See https://issues.apache.org/jira/browse/SQOOP-769 for more information.

View solution in original post

4 REPLIES 4

Re: Sqoop import data using stored procedure

Expert Contributor
Stored procedures are an export only feature. See https://issues.apache.org/jira/browse/SQOOP-769 for more information.

View solution in original post

Highlighted

Re: Sqoop import data using stored procedure

New Contributor

 How do we import more than one table in sqoop, lets say i have two table one is employee and other one is department and both are having primary-foreign key constraints , i want to import some columns from employee table and some from department based on primary-foreign key.

Highlighted

Re: Sqoop import data using stored procedure

New Contributor

2 options.

 

1) import all the data (it's called big data for a reason)

 

2) create a View in your RDBS and sqoop will treat that like a table.

 

Cheers

Pete

 

Highlighted

Re: Sqoop import data using stored procedure

New Contributor

for this requirment you can write join quiry withing sqoop import statement..coz of this u can import only required data in hadoop ecosystem. 

Don't have an account?
Coming from Hortonworks? Activate your account here