hive导入参数
--hive-home 重写$HIVE_HOME
--hive-import 插入数据到hive当中,使用hive的默认分隔符
--hive-overwrite 重写插入
--create-hive-table 建表,如果表已经存在,该操作会报错!
--hive-table [table] 设置到hive当中的表名
--hive-drop-import-delims 导入到hive时删除 \n, \r, and \01
--hive-delims-replacement 导入到hive时用自定义的字符替换掉 \n, \r, and \01
--hive-partition-key hive分区的key
--hive-partition-value hive分区的值
--map-column-hive 类型匹配,sql类型对应到hive类型
sqoop import \
--connect "jdbc:mysql://localhost:3306/managdb?useUnicode=true&characterEncoding=utf-8" --username XX --password xxxx\
--query "select p FROM TB where \$CONDITIONS;" -m 1 \
--null-string 'null' --null-non-string 'null' \
--fields-terminated-by ',' --lines-terminated-by '\n' \
--hive-drop-import-delims \
--target-dir /usr/local/data --as-textfile \
--delete-target-dir;