使用sqoop命令从mysql导入hdfs中。
sqoop import \
--connect jdbc:mysql://localhost:3306/sqoop \
--username root \
--password root \
--table student \
--null-string '@@@' \
--null-non-string '###'
备注:
--null-string含义是 string类型的字段,当Value是NULL,替换成指定的字符,该例子中为@@@
--null-non-string 含义是非string类型的字段,当Value是NULL,替换成指定字符,该例子中为###