sqoop1.4.6 全量导入与增量导入 与使用技巧

全量导入:

sqoop import --connect jdbc:mysql://192.168.0.144:3306/db_blog  --username root  --password 123456  --table t_link  --target-dir /user/hadoop/t_link  --hive-import   --create-hive-table   --hive-overwrite   --num-mappers 1 

  

增量导入:(根据时间促来导入,如果表中没有时间促属性,可以增加一列时间簇)

sqoop import --connect jdbc:mysql://192.168.0.144:3306/db_blog  --username root  --password 123456  --table t_link  --target-dir /user/hadoop/t_link  --hive-import   --check-column crt_time  --incremental lastmodified  --last-value "2016-11-22 21:00:00"  --num-mappers 1 

  

 从HIVE中到出道mysql中

sqoop export --connect jdbc:mysql://192.168.0.144:3306/db_blog  --username root  --password 123456  --table test1  --export-dir /user/hive/warehouse/test1  --input-fields-terminated-by '\t'  --num-mappers 1 

  

posted @ 2016-11-22 21:22  OnTheWay_duking  阅读(5342)  评论(0编辑  收藏  举报