Apache Sqoop(TM) is a tool designed for efficiently transferring bulk data between Apache Hadoop and structured datastores such as relational databases.
It allows users to specify the target location inside of Hadoop
and instruct Sqoop to move data from Oracle,Teradata or other relational databases to the target.
Importing Data
import all the Employee table data which is in MYSQL.
$sqoop import –connect jdbc:mysql://localhost/acmedb \
–table ORDERS –username test –password ****
Import data in hive using sqoop
$ sqoop import –connect jdbc:mysql://localhost/acmedb \
–table ORDERS –username Amar–password ****
–hive-import
Import data in HBase using Sqoop
$ sqoop import –connect jdbc:mysql://localhost/acmedb \
–table ORDERS –username Amar –password **** \
–hbase-create-table –hbase-table ORDERS
–column-family mysql
–hbase-create-table: This option instructs Sqoop to create the HBase table.
–hbase-table: This option specifies the table name to use.
–column-family: This option specifies the column family name to use.
Exporting Data
$sqoop export –connect jdbc:mysql://localhost/acmedb \
–table ORDERS –username Amar–password **** \
–export-dir /user/arvind/ORDERS
Leave a comment