sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nauman Zahid <nauman.goldsm...@gmail.com>
Subject Sqoop Import Using Java Code
Date Thu, 01 May 2014 17:22:35 GMT
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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message