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:[email protected]] 
Sent: Thursday, May 01, 2014 10:23 AM
To: [email protected]
Cc: [email protected]
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.
  • Sqoop Import Us... Nauman Zahid
    • RE: Sqoop ... Ajay Chitre -X (achitre - PERSISTENT SYSTEMS INC at Cisco)

Reply via email to