0

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/

premon
  • 159
  • 1
  • 3
  • 13

1 Answers1

0

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
  • Please rephrase to avoid the impression of asking a question (starting a non-question with "Can" is a local idiom in some parts of the world, but often is mistaken a "the ? is missing".). Also please make this more assertive by avoiding the "try". Also please have a look at https://stackoverflow.com/editing-help to improve readability of your post. If this IS actually a request to try something, then please use your commenting privilege instead of making a tentative, probing answer. – Yunnosch Jul 31 '19 at 07:42