0
votes

I have a problem using sqoop to export hive bigint data to mysql.

The type of the column in mysql and hive is bigint.

I get the following error:

Caused by: java.lang.NumberFormatException: For input string: "3465195470"
...
At java.lang.Integer.parseInt (Integer.java:583)

It seems that an error occurs when converting a string stored in hdfs to a numeric type.

Both hive and mysql columns are bigint types, how do i solve the problem?

add sqoop command

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"
1
plese share sqoop export command - Dev
Use String Type - John Simon
Unfortunately, the type of the mysql column is already bigint. - lucas kim
Show us the Command please? - John Simon
I added the sqoop command to the article. - lucas kim

1 Answers

1
votes

It could be an issue due to missing column or wrong column position.

Also there is no need of --null-string and -null-non-string. These are used in sqoop import commands.