Cca175 question in sqoop export

sqoop
#1

Hi,

I gave my cc175 exam today but unfortunately could not clear it as I got three questions wrong. Out of the three one question was on sqoop export and I would like to get others opinion on this question.

Q) Export file from HDfS location to MySQL database into a table called solution.Table is already created but empty. I used the following syntax to load the data but the job kept failing

sqoop export \
  --connect jdbc:mysql://gateway/problem \
  --username cloudera \
  --password cloudera \
  --table solution \
  --export-dir /hdfslocation

Please let me know whats wrong with the above and how should this be approached for the next time.


Prepare for certifications on our state of the art labs which have Hadoop, Spark, Kafka, Hive and other Big Data technologies

  • Click here for signing up for our state of the art 13 node Hadoop and Spark Cluster

0 Likes

#2

It is tough to answer this question with out knowing the error.

0 Likes

#3

Agreed but what else should be checked or done for such a problem. Is there anything wrong with the syntax?

0 Likes

#4

did you check the what is the delimiters in that file… mysql default delimiter is “,”
if it is different then you must use --input-fields-delimitered-by " xxxxx"

0 Likes

#5

and also please check what is the “lines delimiters”…default is ‘\n’ for mysql.

0 Likes