0
votes

sqoop import-all-tables into hive with default database works fine but Sqoop import-all-tables into hive specified database is not working.

As --hive-database is depreciated how to specify database name

sqoop import-all-tables \
--connect "jdbc:mysql://quickstart.cloudera:3306/retail_db" \
--username root \
--password XXX  \
--hive-import \
--create-hive-table 

The above code creates tables in /user/hive/warehouse/ i.e default directory

How to import all tables into /user/hive/warehouse/retail.db/

1

1 Answers

0
votes

you can set the HDFS path of your database using the option --warehouse-dir. The next example worked for me:

sqoop import-all-tables \
--connect jdbc:mysql://localhost:3306/retail_db \
--username user \
--password password \
--warehouse-dir /apps/hive/warehouse/lina_test.db
--autoreset-to-one-mapper