Hemanth Annavarapu
Hemanth Annavarapu

Reputation: 917

Problems with Sqoop import-all-tables command

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.

Upvotes: 1

Views: 946

Answers (2)

Hems Bhatt
Hems Bhatt

Reputation: 1

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

Upvotes: 0

Kannan Kandasamy
Kannan Kandasamy

Reputation: 13959

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

Upvotes: 1

Related Questions