Sqoop LAB
Sqoop LAB
Commands
Sqoop Help
show databases;
Now, create table in database sqoop_class, there are two ways. First enter into
sqoop_class and then create table
OR use following command,
create table sqoop_class.test1 (name varchar (200), age varchar(200), province
varchar(200));
create table sqoop_test1 (name varchar(200), age varchar(200), province varchar(200)) row
format delimited fields terminated by ',' location '/sqoop/sqoop_hive1/';
Suppose we want to import test1 and test2 (all the tables present in one
database) into HDFS
sqoop import-all-tables --connect jdbc:mysql://localhost/sqoop_class --driver
com.mysql.jdbc.Driver --username root --m 1
Note: at path /user/root same name of table should not already exist.