2017-03-28 10 views
0

sqoopを使用してハイブのbigintデータをmysqlにエクスポートする際に問題があります。Sqoop - ハイブからmysqlへのエクスポート中にエラーが発生しました

mysqlとハイブの列の型はbigintです。

私は次のエラーを取得する:

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

数値型にHDFSに格納されている文字列を変換するときにエラーが発生しているようです。

ハイブとカラムの両方が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" 
+0

pleseはシェアsqoop exportコマンド –

+0

使用文字列型 –

+0

残念ながら、MySQLの列の型はすでにbigint型です。 –

答えて

1

を追加します。

また、--null-stringおよび-null-non-stringの必要はありません。これらは、sqoop importコマンドで使用されます。

関連する問題