Sqoop常用操作命令

Sqoop常用命令

1.MySQL数据导入HIVE

bin/sqoop import -m 1 --driver com.mysql.jdbc.Driver --connect jdbc:mysql://drdshhid48krh5k1public.drds.aliyuncs.com:3306/irobotbox_datawarehouse --username irobotbox_datawarehouse --password HskwPanda047RAHRAxqktlref --table e_country --hive-import --hive-database test --hive-overwrite --create-hive-table --hive-table e_country2 --delete-target-dir

2.SqlServer数据导入到HIVE

sqoop import --connect 'jdbc:sqlserver://aly-rds-hd1-1240-wan.sqlserver.rds.aliyuncs.com:1433;database=irobotbox' --username 'irobotboxuser' --password 'HskwPanda047RAHRAxqktlref' --table 'RB_OrderInfo' --hive-import   --hive-database hive_test_irobotbox  --hive-table rb_orderinfo  --null-string '\\N' --null-non-string '\\N' --where "AddTime>'${old_time}'" --num-mappers 4 --split-by 'ID'

3.PolarDB-X数据导入HIVE(MySQL5.6版本)

sqoop import -m 1 --driver com.mysql.jdbc.Driver --connect jdbc:mysql://drdshhid48krh5k1public.drds.aliyuncs.com:3306/irobotbox_datawarehouse --username irobotbox_datawarehouse --password HskwPanda047RAHRAxqktlref --table e_country --hive-import --hive-database test --hive-overwrite --create-hive-table --hive-table e_country2 --delete-target-dir

4.PolarDB数据导入HIVE(MySQL8.0版本)

/usr/local/service/sqoop_8/bin/sqoop import   --driver com.mysql.cj.jdbc.Driver  --connect jdbc:mysql://pc-bp1up2gi2ea030461-wan.rwlb.rds.aliyuncs.com:3306/irobotbox_instant_sales_customer_666?zeroDateTimeBehavior=convertToNull --username 'mysqladmin' --password 'sh@2019$mysqldb' --table 'test' --hive-import  --create-hive-table --hive-database hive_test_irobotbox --hive-table test14 --m 1  --delete-target-dir

注意: Sqoop导入数据时,如果多个数据源使用同一个Sqoop客户端,需要注意jdbc jar包冲突问题,建议每个数据源使用独立的Sqoop客户端

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值