1
votes

I am trying to import all the tables from several SQL Server databases into HDFS using Sqoop. I am using Cloudera CDH 5.7. So I type the following command:

sqoop import-all-tables --connect "jdbc:sqlserver://X.X.X.X:1433;database=FEPDB" --username XXXXX --password XXXXX --hive-import

It runs successfully but all the tables present in the 'FEPDB' Database are not being imported. I don't find them in the hive directory in the HDFS or when I list all the tables present in Hive.

So I tried to import all the tables into a directory in HDFS and then create hive tables. I gave the following command:

   sqoop import-all-tables --connect "jdbc:sqlserver://X.X.X.X:1433;database=FEPDB" --username XXXXX --password XXXXX --target-dir "/user/FEPDB"

It gives me an error saying

unrecognized argument --target-dir

Doesn't --target-dir argument work with import-all-tables command? And why are all the tables from a database not being imported in the first place? Is there a way to get past these errors and import all the tables in a much easier way?

Any help would be appreciated. Thank you.

2
That is not the problem. I have already tried that.Hemanth Annavarapu

2 Answers

1
votes

import-all-tables expect parameter with --warehouse-dir, provide warehouse-dir and hdfs path, it will work

0
votes

Please try this: sqoop import-all-tables --connect "jdbc:sqlserver://X.X.X.X:1433;database=FEPDB" --username XXXXX --password XXXXX --warehouse-dir