You're now ready to use SQL Server-Hadoop Connector and import data from SQL Server 2012 to HDFS. The input to the import process is a SQL Server table, which will be read row-by-row into HDFS by Sqoop. The output of this import process is a set of files containing a copy of the imported table. Since the import process is performed in parallel, the output will be in multiple files.
When using the sqoop import
command, you must specify the following mandatory arguments:
--connect
argument specifying the connection string to the SQL Server database--username
and--password
arguments to provide valid credentials to connect to the SQL Server database--table
or--query
argument to import an entire table or results of a custom query execution
The following command imports data from ErrorLog
table in SQL Server Adventureworks2012
database to delimited text files in /data/ErrorLogs
directory on HDFS.