0
votes

I have a mysql table looks like:

Mebmer_ID <- primary key
Member_Name
Member_Type

I ran the command below:

./bin/sqoop import --connect jdbc:mysql://${ip}/testdb -username root -password blabla --query 'SELECT * from member where Member_ID < 5 AND $CONDITIONS' --split-by Member_ID --hbase-create-table --hbase-table member --column-family i

But after import, I see hbase table looks like:

rowkey   -  row : 1
Columns - Member_name=bla, Member_Type=bla

Note that Sqoop turned my Member_ID to Rowkey which is expected. But in my columns, I am seeing all the other fields except Member_ID. Is there anyway I can have Member_ID as my rowkey,also in Column Family, having the Member_ID column included as well?

Does this also mean, if my primary key is not called "id", after sqoop import, I am losing the name of my primary key. In my case, after import, I have no idea what rowkey used to be called "Mmember_ID".

1

1 Answers

2
votes

Got it sorted by setting property sqoop.hbase.add.row.key.

e.g. sqoop import -Dsqoop.hbase.add.row.key=true