Sqoop – Importing specific columns in HBase

The following command will import data from MySQL into Hbase columnar database for a few specified columns from a certain table.

Connect to MySQL and verify that the source table is present. Make a note of the names of the table and columns.

To move data from MySQL to Hbase, run the following command in the Hadoop terminal.

sqoop import \
–connect jdbc:mysql://localhost/dbTest \
–username root
–password root
–table tbEmployee \
–columns “EmpNo, EName” \
–hbase-table Employee \
–column-family EmpName \
–hbase-row-key EmpNo \
-m 1;

Once the transfer is completed, connect to Hbase and use the following command to check if the data is populated into the table.

scan ‘Employee’;

Hope you find this article helpful.

Please subscribe for more interesting updates.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s