转载请注明出处:http://blog.csdn.net/l1028386804/article/details/46517039
SQOOP是用于对数据进行导入导出的。
(1)把MySQL、Oracle等数据库中的数据导入到HDFS、Hive、HBase中sqoop import --connect jdbc:mysql://hadoop0:3306/hive --username root --password admin --table TBLS --fields-terminated-by '\t' --null-string '**' -m 1 --append --hive-import
sqoop import --connect jdbc:mysql://hadoop0:3306/hive --username root --password admin --table TBLS --fields-terminated-by '\t' --null-string '**' -m 1 --append --hive-import --check-column 'TBL_ID' --incremental append --last-value 6
sqoop export --connect jdbc:mysql://hadoop0:3306/hive --username root --password admin --table ids --fields-terminated-by '\t' --export-dir '/ids'
sqoop job --create myjob -- import --connect jdbc:mysql://hadoop0:3306/hive --username root --password admin --table TBLS --fields-terminated-by '\t' --null-string '**' -m 1 --append --hive-import
原文地址:http://blog.csdn.net/l1028386804/article/details/46517039