本案例为从Hive中导入至Mysql
注意:hive中的字段和mysql的字段一定要一样。字段类型也要一样。
我们可以通过columns 一批字段的进行测试。一定要注意时间字段
sqoop export \
--connect "jdbc:mysql://ip:3306/test?useUnicode=true&characterEncoding=utf-8" \
--username root --password 123456 \
--table t_customer_give_info \
--columns "c_sls_cde,level,insure_name,insure_age,insure_sex,insure_mobile,group_work,top_code,register_time,prod_name,received_time,start_date,end_date,policy_name,policy_age,policy_sex,relationship" \
--input-null-string '\\N' \
--input-null-non-string '\\N' \
--export-dir "/db/CDH" \
--input-fields-terminated-by ',' \
-m 1