May 2017
Beginner to intermediate
596 pages
15h 2m
English
As indicated earlier during the installation steps, Sqoop can also import/export data with HBase as destination/source respectively. Here we shall see how to initiate data import from RDBMS into HBase using Sqoop.
bin/sqoop import --connect jdbc:postgresql://<DB_SERVER_ADDRESS>/<DB_NAME>?schema=<SCHEMA> --table <TABLE_NAME> --m 1 --username <DB_USER_NAME> --password <DB_PASSWORD> -hbase-table <HBASE_TABLE_NAME> --column-family <HBASE_COLUMN_FAMILY_NAME> -hbase-create-table
An example with filled-in values for the above command is as shown as follows:
sqoop import --connect jdbc:postgresql://<CentOS_IP>/sourcedb?schema=public --table customer --m 1 --username postgres --password <password> -hbase-table customer --column-family ...