Results 1 to 2 of 2

Thread: Can we split Sqoop job by multiple column combination

  1. #1
    Senior Member
    Join Date
    Mar 2013
    Posts
    416,482

    Can we split Sqoop job by multiple column combination

    I am using below Sqoop syntax to split Sqoop job by single column[mostly primary key].
    sqoop import --connect jdbc:oracle:thin:@//oracle_server:1521/sid --username xxx --password xxx --table EMPLOYEE --split-by ID -m 10
    Can we use multiple columns as combination, if primary key is not available to split Sqoop job?
    sqoop import --connect jdbc:oracle:thin:@//oracle_server:1521/sid --username xxx --password xxx --table EMPLOYEE --split-by FIRST_NAME,LAST_NAME -m 10

    Check Solution

  2. #2
    Banned
    Join Date
    Jul 2015
    Posts
    161
    Case 1: If table have primary key and import all the column of MySQL table into HBase table.

    $ bin/sqoop import --connect jdbc:mysql://localhost/db1 --username root --password root --table tableName --hbase-table hbase_tableName --column-family hbase_table_col1 --hbase-create-table

    Case 2: If table have primary key and import only few columns of MySQL table into HBase table.

    $ bin/sqoop import --connect jdbc:mysql://localhost/db1 --username root --password root --table tableName --hbase-table hbase_tableName --columns column1,column2 --column-family hbase_table_col1 --hbase-create-table

    Note : Column names specified in --columns attribute must contain the primary key column.

    Case 3: If table doesn't have primary key then choose one column as a hbase-row-key. Import all the column of MySQL table into HBase table.

    $ bin/sqoop import --connect jdbc:mysql://localhost/db1 --username root --password root --table tableName --hbase-table hbase_tableName --column-family hbase_table_col1 --hbase-row-key column1 --hbase-create-table

    Case 4: If table doesn't have primary key then choose one column as a hbase-row-key. Import only few columns of MySQL table into HBase table.

    $ bin/sqoop import --connect jdbc:mysql://localhost/db1 --username root --password root --table tableName --hbase-table hbase_tableName --columns column1,column2 --column-family hbase_table_col --hbase-row-key column1 --hbase-create-table



    Maharaja Express

Similar Threads

  1. Replies: 0
    Last Post: 05-01-2015, 08:00 AM
  2. Replies: 0
    Last Post: 05-05-2014, 10:40 AM
  3. Replies: 0
    Last Post: 04-03-2014, 02:40 AM
  4. Java - Class not found exception while running sqoop: org/apache/sqoop/Sqoop
    By Bandhavi in forum Programming languages basics
    Replies: 0
    Last Post: 01-02-2014, 12:11 PM
  5. Replies: 0
    Last Post: 12-13-2012, 09:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •