Reputation: 1
I used:
sqoop import-all-tables --m 1 --connect jdbc:mysql://quickstart.cloudera:3306/retail_db --username retail_dba --password cloudera --hive-import --create-hive-table --hive-overwrite --hive-database default --warehouse-dir /user/hive/warehouse
I see only categories table is imported. We have 6 tables in MySQL.
Aftr importing this table, I see categories dir and command not exiting.
When I logged in to hive, I don't see any tables under default table.
I am using by default setting comes with CDH 5.12. Not changed any configurations. Please advise.
Upvotes: 0
Views: 611
Reputation: 1669
There is no issue in your command, Check whether the default schema is having any tables before use run the command.
Or create a new DB and execute the command.
hive> create database retaildb;
OK
Time taken: 0.38 seconds
hive> use retaildb;
OK
Time taken: 0.023 seconds
hive> show tables;
OK
mysql> show tables;
+---------------------+
| Tables_in_retail_db |
+---------------------+
| avrotable |
| categories |
| customers |
| departments |
| departments_new |
| order_items |
| orders |
| products |
| products_replica |
| tablewithboolean |
| test |
+---------------------+
Execute sqoop command.
sqoop import-all-tables --m 1 --connect jdbc:mysql://quickstart.cloudera:3306/retail_db --username retail_dba --password cloudera \
--hive-import --create-hive-table --hive-overwrite --hive-database retaildb --warehouse-dir /user/hive/warehouse/retail_db
hive> show tables;
OK
avrotable
categories
customers
departments
departments_new
order_items
orders
products
products_replica
tablewithboolean
test
Time taken: 0.24 seconds, Fetched: 11 row(s)
Upvotes: 1