You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by DEEPAK SHARMA <de...@outlook.com> on 2016/08/24 04:47:48 UTC

Regarding sqoop export

Hello,


My sqoop export is failing with a message that I am unable to solve.


Below is my table structure in MySQL.It doesnt have primary key.I am using cloudera 5.4


id |department


I have below data in HDFS


1,Test1

2,Test2


Initailly I used below sqoop command to export the data into the table


sqoop export --table product --connect jdbc:mysql://localhost/loudacre --username training --password training
--export-dir /export --update-mode allowinsert

Now I modified the file in HDFS to below data


1,Test1

2,TestTest

3,Test3


and ran below sqoop command


sqoop export --table product --connect jdbc:mysql://localhost/loudacre --username training --password training
--export-dir /export --update-mode allowinsert --update-key id

The data in the database ws updated however in logs I can see error message :- "
Can't parse input data: 'null'

and also it has inserted duplicate data.
Can anyone help me in finding the root cause.








Re: Regarding sqoop export

Posted by DEEPAK SHARMA <de...@outlook.com>.
For new insert it works fine.Only when I try to update existing rows it fails.



Regards

Deepak


________________________________
From: DEEPAK SHARMA <de...@outlook.com>
Sent: Wednesday, August 24, 2016 10:17 AM
To: user@sqoop.apache.org
Subject: Regarding sqoop export


Hello,


My sqoop export is failing with a message that I am unable to solve.


Below is my table structure in MySQL.It doesnt have primary key.I am using cloudera 5.4


id |department


I have below data in HDFS


1,Test1

2,Test2


Initailly I used below sqoop command to export the data into the table


sqoop export --table product --connect jdbc:mysql://localhost/loudacre --username training --password training
--export-dir /export --update-mode allowinsert

Now I modified the file in HDFS to below data


1,Test1

2,TestTest

3,Test3


and ran below sqoop command


sqoop export --table product --connect jdbc:mysql://localhost/loudacre --username training --password training
--export-dir /export --update-mode allowinsert --update-key id

The data in the database ws updated however in logs I can see error message :- "
Can't parse input data: 'null'

and also it has inserted duplicate data.
Can anyone help me in finding the root cause.