Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

creating two column familes with one sqoop command

Master Collaborator

the command below creates one column family successfully , how can I add another column family to this command ?

sqoop import --connect "jdbc:oracle:thin:@(description=(address=(protocol=tcp)(host=patronQA)(port=1526))(connect_data=(service_name=patron)))" --username PATRON --password xxxx --table PATRON.AUDIT_TOUR_SMALL --hbase-table AUDIT_TOUR --column-family TOUR --hbase-row-key "TOUR_ID" --hbase-create-table --columns "TOUR_ID,HOST_TOUR_ID,PLAZA_ID,REV_DAY_ID,LANE_ID,HOST_EMP_ID" -m 1
1 ACCEPTED SOLUTION

Super Guru

You import into hbase column family one at a time. if you have 2 column families you import into each with two sqoop run. if you have 3 CF then it takes 3 sqoop runs.

Here is good examples from here

$ sqoop import 
    --connect jdbc:mysql://localhost/serviceorderdb 
    --username root -P 
    --table customercontactinfo 
    --columns "customernum,customername" 
    --hbase-table customercontactinfo 
    --column-family CustomerName 
    --hbase-row-key customernum -m 1
Enter password:
...
13/08/17 16:53:01 INFO mapreduce.ImportJobBase: Retrieved 5 records.
$ sqoop import 
    --connect jdbc:mysql://localhost/serviceorderdb 
    --username root -P 
    --table customercontactinfo 
    --columns "customernum,contactinfo" 
    --hbase-table customercontactinfo 
    --column-family ContactInfo 
    --hbase-row-key customernum -m 1
Enter password:
...
13/08/17 17:00:59 INFO mapreduce.ImportJobBase: Retrieved 5 records.
$ sqoop import 
    --connect jdbc:mysql://localhost/serviceorderdb 
    --username root -P 
    --table customercontactinfo 
    --columns "customernum,productnums" 
    --hbase-table customercontactinfo 
    --column-family ProductNums 
    --hbase-row-key customernum -m 1
Enter password:
...
13/08/17 17:05:54 INFO mapreduce.ImportJobBase: Retrieved 5 records.

View solution in original post

1 REPLY 1

Super Guru

You import into hbase column family one at a time. if you have 2 column families you import into each with two sqoop run. if you have 3 CF then it takes 3 sqoop runs.

Here is good examples from here

$ sqoop import 
    --connect jdbc:mysql://localhost/serviceorderdb 
    --username root -P 
    --table customercontactinfo 
    --columns "customernum,customername" 
    --hbase-table customercontactinfo 
    --column-family CustomerName 
    --hbase-row-key customernum -m 1
Enter password:
...
13/08/17 16:53:01 INFO mapreduce.ImportJobBase: Retrieved 5 records.
$ sqoop import 
    --connect jdbc:mysql://localhost/serviceorderdb 
    --username root -P 
    --table customercontactinfo 
    --columns "customernum,contactinfo" 
    --hbase-table customercontactinfo 
    --column-family ContactInfo 
    --hbase-row-key customernum -m 1
Enter password:
...
13/08/17 17:00:59 INFO mapreduce.ImportJobBase: Retrieved 5 records.
$ sqoop import 
    --connect jdbc:mysql://localhost/serviceorderdb 
    --username root -P 
    --table customercontactinfo 
    --columns "customernum,productnums" 
    --hbase-table customercontactinfo 
    --column-family ProductNums 
    --hbase-row-key customernum -m 1
Enter password:
...
13/08/17 17:05:54 INFO mapreduce.ImportJobBase: Retrieved 5 records.
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.