sqoop import --connect jdbc:oracle:thin:@192.168.31.222:1521:orcl --username shebaouser --password shebaouser --table ORG_PAY_INFO --num-mappers 2 --delete-target-dir --hive-import --hive-database bdd --hive-table ORG_PAY_INFO --hive-overwrite --fields-terminated-by '\t'
1.995 s BY01
sqoop import --connect jdbc:oracle:thin:@192.168.31.222:1521:orcl --username shebaouser --password shebaouser --table IY02 --num-mappers 10 --direct --target-dir /user/hive/warehouse/shebaouser --delete-target-dir --hive-import --hive-database bdd --hive-table IY02 --hive-overwrite --fields-terminated-by '\t'
2S iy02
sqoop import --connect jdbc:oracle:thin:@192.168.31.222:1521:orcl --username shebaouser --password shebaouser --table IY11 --num-mappers 10 --direct --target-dir /user/hive/warehouse/shebaouser --delete-target-dir --hive-import --hive-database bdd --hive-table IY11 --hive-overwrite --fields-terminated-by '\t'
--------------------------
sqoop create-hive-table --connect jdbc:oracle:thin:@192.168.31.222:1521:orcl --username shebaouser --password shebaouser --hive-table PEOPLE_BASE_INFO --table PEOPLE_BASE_INFO --fields-terminated-by '\t'
hive修改列类型,double格式在kettl中没法支持,需要修改为string
alter table org_base_info change id旧列名 id新列名 string comment 'id注释' first;
sqoop导入数据
sqoop import --connect jdbc:oracle:thin:@192.168.31.222:1521:orcl --username shebaouser --password shebaouser --table PEOPLE_PAY_INFO --num-mappers 2 --delete-target-dir --hive-import --hive-database default --hive-table PEOPLE_PAY_INFO --hive-overwrite --fields-terminated-by '\t'
如果没有主键,则需要指定--m 1,一个mapper