sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ajay Chitre -X (achitre - PERSISTENT SYSTEMS INC at Cisco)" <achi...@cisco.com>
Subject RE: Sqoop Import Using Java Code
Date Fri, 02 May 2014 15:01:51 GMT
If you're using Maven use a dependency such as this:

<dependency>
	<groupId>org.apache.sqoop</groupId>
	<artifactId>sqoop</artifactId>
	<version>1.4.4</version>
</dependency>
            

If you're not using Maven, consider using it.  It will help you tremendously in the long run.
 Hope this helps.  Thanks.


-----Original Message-----
From: Nauman Zahid [mailto:nauman.goldsmith@gmail.com] 
Sent: Thursday, May 01, 2014 10:23 AM
To: dev@sqoop.apache.org
Cc: shuja@pucit.edu.pk
Subject: Sqoop Import Using Java Code

Hello!
I am using the following code to try to import data from mysql database to
Hbase:
SqoopOptions options = new SqoopOptions();
        options.setConnectString("jdbc:mysql://localhost:3306/testDb");
        options.setTableName("student");
        //options.setWhereClause("id>10");     // this where clause works
when importing whole table, ie when setTableName() is used
        options.setUsername("root");
        options.setPassword("");
        //options.setDirectMode(true);    // Make sure the direct mode is
off when importing data to HBase
        options.setNumMappers(8);         // Default value is 4


        // HBase options
        options.setHBaseTable("HBASE_student");
        options.setHBaseColFamily("colFamily");
        options.setCreateHBaseTable(true);    // Create HBase table, if it
does not exist
        options.setHBaseRowKeyColumn("stdId");

        @SuppressWarnings({ "unused" })
        int ret = new ImportTool().run(options);

Could you please tell me which jars (plz be specific with the versions) I have to include
in my class path. I have tried a number of combination but in the end I end up in a conflict.

Regards.
Mime
View raw message