0

I am trying to import data from RDBMS(Mysql) to HDFS. I did some reading on Sqoop tutorials and found few helpful links. http://devslogics.blogspot.com/2013/09/sqoop-java-client.html?showComment=1399588094791#c7484088811270691337 I am able to import data to HDFS in TEXT_FILE with the code from the link pasted above. Sqoop by default uses comma as default delimiter. This doesn't work for me. What i m trying to achieve now is to customize delimiters/escape chars.

Also i am able to do so through shell by executing the following command sqoop import --connect jdbc:mysql://xxx.xx.xx:3306/sqoop --username xxx --password xxx --table students --enclosed-by \" --escaped-by \"

Any help in how to implement this through sqoop-client java api is much appreciated.

Thanks in advance Sean

sean
  • 21
  • 3

1 Answers1

0

It appears from the blog post you linked that you are using Sqoop2.

Unfortunately, Sqoop2 doesn't let you set a delimiter yet.

When you run the commandline "sqoop", you are running Sqoop1, which supports more options at this point.

You can use Sqoop1 in your java code by following the top answer here: How to use Sqoop in Java Program?

Community
  • 1
  • 1
Gwen Shapira
  • 4,978
  • 1
  • 24
  • 23