我在使用sqoop将hive数据导出到mysql时遇到了问题。
mysql和hive中列的类型是bigint。
我得到以下错误:
Caused by: java.lang.NumberFormatException: For input string: "3465195470"
...
At java.lang.Integer.parseInt (Integer.java:583)当将存储在hdfs中的字符串转换为数字类型时,似乎会发生错误。
hive和mysql列都是bigint类型,如何解决这个问题?
添加sqoop命令
export -connect "jdbc:mysql://{url}/{db}?{option}"
--username {username}
--password {password}
--table {username}
--columns "column1,column2,column3"
--export-dir /apps/hive/warehouse/tmp.db/{table}
--update-mode allowinsert
--update-key column1
--input-fields-terminated-by "\001"
--input-null-string "\\N"
--input-null-non-string "\\N"
--null-string "\\N"
--null-non-string "\\N"发布于 2017-03-28 13:54:14
这可能是由于缺少列或列位置错误造成的问题。
此外,也不需要--null-string和-null-non-string。这些在sqoop import命令中使用。
https://stackoverflow.com/questions/43067601
复制相似问题