A)
1.) sqoop import --username=training --password=training
--connect jdbc:mysql://localhost/training --table emp -m 1 ;
2.)
hive> create table emp(id int,ename string,sal int)
> row format delimited
> fields terminated by ','
> lines terminated by '\n'
> stored as textfile;
OK
3.)
hive> load data inpath '/user/training/emp/part-m-00000' into table emp;
4)
hive> select * from emp;
OK
1 ssss 20000
2 srsss 30000
3 john 33000
4 jsohn 34000
B) sqoop import --username training --password training -connect
jdbc:mysql://localhost/training --table std -m 1 --hive-import;
No comments:
Post a Comment