Importing unstructured data to Hadoop HDFS from MySQL
Using Sqoop, we can transfer data from relational database to Hadoop HDFS. As Sqoop uses Java Database Connectivity (JDBC) driver for connecting with the source, it can be used with any relational database having support of JDBC connection strings. In the previous section, we downloaded and configured Sqoop's MySQL connector, so now let's see how to connect with MySQL databases from Sqoop and transfer the data to HDFS.
Sqoop import for fetching data from MySQL 8
To understand Sqoop's import process, let's create a database and table in MySQL 8, which we will use throughout the chapter for demonstrating examples:
Sqoop provides import
command to import data from relational database to HDFS. Following are generic commands used for importing data using Sqoop:
sqoop import (generic-args) (import-args) sqoop-import (generic-args) (import-args)
generic-args
are common parameter for export such as providing JDBC connection string, JDBC driver name...