

{"id":6946,"date":"2018-02-01T09:26:30","date_gmt":"2018-02-01T09:26:30","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=6946"},"modified":"2021-12-07T13:46:51","modified_gmt":"2021-12-07T08:16:51","slug":"sqoop-import","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/sqoop-import\/","title":{"rendered":"Sqoop Import- Importing Data From RDBMS to HDFS"},"content":{"rendered":"<p>In the last article, we discussed\u00a0<a href=\"https:\/\/data-flair.training\/blogs\/sqoop-export\/\"><strong>Sqoop Export<\/strong><\/a>. In this article we will discuss Sqoop import,<strong>\u00a0<\/strong>a\u00a0tool which we use for importing tables from RDBMS to<a href=\"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-tutorial\/\"><strong> HDFS<\/strong><\/a> is the Sqoop Import tool. Here, we will learn how to Sqoop import multiple tables from RDBMS database to<strong><a href=\"https:\/\/data-flair.training\/blogs\/hadoop-tutorial\/\"> Hadoop <\/a><\/strong>HDFS.<\/p>\n<p>Moreover, we will learn the purpose of importing in Sqoop, Sqoop import syntax as well as Sqoop import query examples to understand it well.<\/p>\n<p>So, let&#8217;s start the Sqoop Import tutorial.<\/p>\n<h3>Sqoop Import and its Purpose<\/h3>\n<p>A tool, which we use for importing tables from RDBMS to HDFS is the Sqoop Import tool. Basically, here each row in a table is considered as a record in HDFS. Moreover, when we talk about text files all records are stored as text data.<\/p>\n<p>Whereas when we talk about Avro and sequence files all records are stored as binary data here. Basically, we can say the Sqoop Import all tables as individual tables from RDBMS to HDFS.<\/p>\n<p>Let&#8217;s discuss <a href=\"https:\/\/data-flair.training\/blogs\/features-of-hadoop-hdfs\/\"><strong>HDFS Features<\/strong><\/a><\/p>\n<h3>Sqoop Import Syntax<\/h3>\n<p>To import data into HDFS we use the following syntax for importing in Sqoop. Such as:<br \/>\n<b>$ sqoop import (generic-args) (import-args)<\/b><br \/>\n<b>$ sqoop-import (generic-args) (import-args)<\/b><br \/>\nThe very advantage is we can type the sqoop import arguments in any order with respect to one another. However, when it comes to the <a href=\"https:\/\/data-flair.training\/blogs\/hadoop-features-and-design-principles\/\"><strong>Hadoop<\/strong><\/a> generic arguments, those must precede any import arguments only.<br \/>\nBasically, here all the arguments are grouped into collections which are organized by function. However, some collections are present in several tools here. For example, the &#8220;common&#8221; arguments.<br \/>\n<strong>Table 1. Sqoop Import &#8211; Common arguments<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Argument<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;connect &lt;jdbc-uri&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specify JDBC connect string<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;connection-manager &lt;class-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specify connection manager class to use<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;driver &lt;class-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Manually specify JDBC driver class to use<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hadoop-mapped-home &lt;dir&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Override $HADOOP_MAPRED_HOME<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;help<\/span><\/td>\n<td><span style=\"font-weight: 400\">Print usage instructions<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;password-file<\/span><\/td>\n<td><span style=\"font-weight: 400\">Set path for a file containing the authentication password<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">-P<\/span><\/td>\n<td><span style=\"font-weight: 400\">Read password from console<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;password &lt;password&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Set authentication password<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;username &lt;username&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Set authentication username<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;verbose<\/span><\/td>\n<td><span style=\"font-weight: 400\">Print more information while working<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;connection-param-file &lt;filename&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Optional properties file that provides connection parameters<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;relaxed-isolation<\/span><\/td>\n<td><span style=\"font-weight: 400\">Set connection transaction isolation to read uncommitted for the mappers.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>a. Connecting to a Database Server<br \/>\n<span style=\"font-weight: 400\"><a href=\"https:\/\/data-flair.training\/blogs\/sqoop-introduction\/\"><strong>Sqoop<\/strong><\/a> is designed to import tables from a database into <a href=\"https:\/\/data-flair.training\/blogs\/hadoop-high-availability-tutorial\/\"><strong>HDFS<\/strong><\/a>. To do so, you must specify a connect string that describes how to connect to the database. The connect string is similar to a URL, and is communicated to Sqoop with the &#8211;connect argument. That defines the server and database to connect to; also specify the port.<\/span><\/h4>\n<h4><strong>For example:<\/strong><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/database.example.com\/employees<br \/>\n<strong>Table 2. Sqoop Import &#8211; Validation arguments More Details<\/strong><\/h4>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;validate<\/span><\/td>\n<td><span style=\"font-weight: 400\">Enable validation of data copied, supports single table copy only.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;validator &lt;class-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specify validator class to use.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;validation-threshold &lt;class-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specify validation threshold class to use.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;validation-failurehandler &lt;class-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specify validation failure handler class to use.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Table 3. Sqoop Import &#8211; Import control arguments<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;append<\/span><\/td>\n<td><span style=\"font-weight: 400\">Append data to an existing dataset in HDFS<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;as-avrodatafile<\/span><\/td>\n<td><span style=\"font-weight: 400\">Imports data to Avro Data Files<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;as-sequencefile<\/span><\/td>\n<td><span style=\"font-weight: 400\">Imports data to SequenceFiles<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;as-textfile<\/span><\/td>\n<td><span style=\"font-weight: 400\">Imports data as plain text (default)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;as-parquetfile<\/span><\/td>\n<td><span style=\"font-weight: 400\">Imports data to Parquet Files<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;boundary-query &lt;statement&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Boundary query to use for creating splits<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;columns &lt;col,col,col\u2026&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Columns to import from table<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;delete-target-dir<\/span><\/td>\n<td><span style=\"font-weight: 400\">Delete the import target directory if it exists<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;direct<\/span><\/td>\n<td><span style=\"font-weight: 400\">Use direct connector if exists for the database<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;fetch-size &lt;n&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Number of entries to read from database at once.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;inline-lob-limit &lt;n&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Set the maximum size for an inline LOB<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">-m,&#8211;num-mappers &lt;n&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Use n map tasks to import in parallel<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">-e,&#8211;query &lt;statement&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Import the results of statement.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;split-by &lt;column-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Column of the table used to split work units. Cannot be used with &#8211;autoreset-to-one-mapperoption.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;autoreset-to-one-mapper<\/span><\/td>\n<td><span style=\"font-weight: 400\">Import should use one mapper if a table has no primary key and no split-by column is provided. Cannot be used with &#8211;split-by &lt;col&gt; option.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;table &lt;table-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Table to read<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;target-dir &lt;dir&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">HDFS destination dir<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;warehouse-dir &lt;dir&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">HDFS parent for table destination<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;where &lt;where clause&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">WHERE clause to use during import<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">-z,&#8211;compress<\/span><\/td>\n<td><span style=\"font-weight: 400\">Enable compression<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;compression-codec &lt;c&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Use Hadoop codec (default gzip)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;null-string &lt;null-string&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">The string to be written for a null value for string columns<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;null-non-string &lt;null-string&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">The string to be written for a null value for non-string columns<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Although, both &#8211;null-string and &#8211;null-non-string arguments are optional.However, we use the string &#8220;null&#8221; if not specified.<\/p>\n<h4>b. Selecting the Data to Import<br \/>\n<span style=\"font-weight: 400\">Basically, Sqoop imports data in a table-centric fashion. we generally use the &#8211;table argument while selecting the table to import. like, &#8211;table employees. However, this argument in a database can also identify a VIEW or other table-like entity.<\/span><br \/>\n<span style=\"font-weight: 400\">However, all the data is written to <a href=\"https:\/\/data-flair.training\/blogs\/top-hadoop-hdfs-commands-tutorial\/\"><strong>HDFS<\/strong><\/a> in its &#8220;natural order&#8221;. That is a table containing columns A, B, and C results in an import of data in Sqoop. Such as:<\/span><br \/>\n<strong>A1,B1,C1<\/strong><br \/>\n<strong>A2,B2,C2<\/strong><br \/>\n<strong>&#8230;<\/strong><br \/>\n<span style=\"font-weight: 400\">By selecting a subset of columns, with\u00a0&#8211;columns argument we can control their ordering. The only condition is that it should include a comma-delimited list of columns to import. Like: &#8211;columns &#8220;name,employee_id,jobtitle&#8221;.<\/span><\/h4>\n<h4>c. Free-form Query Imports<br \/>\n<span style=\"font-weight: 400\">We can also import the result set of an arbitrary SQL query in Sqoop. Also, we\u00a0can specify a SQL statement with the &#8211;query argument. Despite using the &#8211;table, &#8211;columns and &#8211;where arguments.<\/span><\/h4>\n<h4>While we import a free-form query,\u00a0we need to specify a destination directory with &#8211;target-dir.<br \/>\nIn addition, we can import the results of a query in parallel. Afterwards,\u00a0 each map task will need to execute a copy of the query, with results partitioned by bounding conditions inferred by Sqoop. However, our query must include the token $CONDITIONS. That each Sqoop process will replace with a unique condition expression. Also important to select a splitting column with &#8211;split-by.<\/h4>\n<h4><strong>For example:<\/strong><br \/>\n$ sqoop import \\<br \/>\n&#8211;query &#8216;SELECT a.*, b.* FROM a JOIN b on (a.id == b.id) WHERE $CONDITIONS&#8217; \\<br \/>\n&#8211;split-by a.id &#8211;target-dir \/user\/foo\/joinresults<br \/>\n<span style=\"font-weight: 400\">By specifying a single map task with -m 1, the query can be executed once and imported serially.<\/span><br \/>\n$ sqoop import \\<br \/>\n&#8211;query &#8216;SELECT a.*, b.* FROM a JOIN b on (a.id == b.id) WHERE $CONDITIONS&#8217; \\<br \/>\n-m 1 &#8211;target-dir \/user\/foo\/joinresults<\/h4>\n<h4>d. Controlling Parallelism<br \/>\n<span style=\"font-weight: 400\">From most database sources, Sqoop imports data in parallel. Also, to perform the import in sqoop by using the -m or &#8211;num-mappers argument. Moreover, we can specify the number of map tasks (parallel processes) to use each of these arguments takes an integer value which corresponds to the degree of parallelism to employ.\u00a0<\/span><\/h4>\n<h4>e. Controlling Distributed Cache<br \/>\n<span style=\"font-weight: 400\">Basically, in $SQOOP_HOME\/lib folder, Sqoop will copy the jars to job cache every time when starting a Sqoop job. However,\u00a0 when\u00a0 Oozie launched it, this is unnecessary since Oozie uses its own Sqoop share lib which keeps Sqoop dependencies in the distributed cache. Although,\u00a0for the Sqoop dependencies Oozie will do the localization on each worker node only once during the first Sqoop job. Also, reuse the jars on worker node for subsequential jobs.\u00a0<\/span><\/h4>\n<h4>f. Controlling the Sqoop Import Process<br \/>\n<span style=\"font-weight: 400\">The import process in sqoop will use JDBC, by default. That provides a reasonable cross-vendor import channel. However, by using database-specific data movement tools, some databases can perform imports in a more high-performance fashion.<\/span><\/h4>\n<h4>In addition, inside your home directory in<strong> <a href=\"https:\/\/data-flair.training\/blogs\/hadoop-hdfs-architecture\/\">HDFS<\/a><\/strong>, Sqoop will import a table named foo to a directory named foo. For example, the Sqoop import tool will write to \/user\/someuser\/foo\/(files) if your username is some user. However, we can adjust the parent directory of the import with the &#8211;warehouse-dir argument. For example:<br \/>\n$ sqoop import &#8211;connnect &lt;connect-str&gt; &#8211;table foo &#8211;warehouse-dir \/shared \\<br \/>\n<span style=\"font-weight: 400\"> \u00a0\u00a0\u00a0&#8230;<\/span><\/h4>\n<h4>g. Controlling transaction isolation<br \/>\n<span style=\"font-weight: 400\">Basically,\u00a0to import data the read committed transaction isolation in the mappers are used in Sqoop. In all ETL workflows, this may not be the ideal. Yet it may desire to reduce the isolation guarantees. However, to instruct Sqoop to use read uncommitted isolation level we can use the &#8211;relaxed-isolation option.<\/span><\/h4>\n<h4>Although, on all databases, the read-uncommitted isolation level is not supported. For example, Oracle. So specifying the option &#8211;relaxed-isolation may not be supported on all databases.<\/h4>\n<h4>h. Controlling type mapping<br \/>\n<span style=\"font-weight: 400\">Basically, to map most SQL types to appropriate <a href=\"https:\/\/data-flair.training\/blogs\/java-tutorial\/\"><strong>Java<\/strong><\/a> or <a href=\"https:\/\/data-flair.training\/blogs\/apache-hive-tutorial\/\"><strong>Hive<\/strong><\/a> representatives, Sqoop is preconfigured.\u00a0Although, here also\u00a0the default mapping might not be suitable for everyone. Also, might be overridden. Either by &#8211;map-column-java (for changing the mapping to Java) or &#8211;map-column-hive (for changing Hive mapping).<\/span><br \/>\n<strong>Table 4. Parameters for overriding mapping<\/strong><\/h4>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;map-column-java &lt;mapping&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Override mapping from SQL to Java type for configured columns.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;map-column-hive &lt;mapping&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Override mapping from SQL to Hive type for configured columns.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Basically, Sqoop is expecting the comma-separated list of mapping in the form &lt;name of column&gt;=&lt;new type&gt;. For example:<br \/>\n$ sqoop import &#8230; &#8211;map-column-java id=String,value=Integer<br \/>\n<span style=\"font-weight: 400\">Also, Sqoop will raise the exception in case that some configured mapping will not be used.<\/span><\/p>\n<h4>i. Incremental Imports<br \/>\n<span style=\"font-weight: 400\">There is an incremental import mode offered by Sqoop. That can be used to retrieve only rows newer than some previously imported set of rows.<\/span><br \/>\nThe following arguments control incremental imports in sqoop:<br \/>\n<strong>Table 5. Sqoop Import &#8211; Incremental import arguments<\/strong><\/h4>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;check-column (col)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specifies the column to be examined when determining which rows to import. (the column should not be of type CHAR\/NCHAR\/VARCHAR\/VARNCHAR\/ LONGVARCHAR\/LONGNVARCHAR)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;incremental (mode)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specifies how Sqoop determines which rows are new. Legal values for mode include append and lastmodified.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;last-value (value)<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specifies the maximum value of the check column from the previous import.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Basically, there are two types of incremental imports in Sqoop.One is appended and second is last modified.\u00a0Moreover, to specify the type of incremental import to perform, we can also use the &#8211;incremental argument.<\/p>\n<h4>j. File Formats<br \/>\n<span style=\"font-weight: 400\">Basically, there are two file formats in which we can import data. One is delimited text or other is SequenceFiles.<\/span><\/h4>\n<h4>k. Large Objects<br \/>\n<span style=\"font-weight: 400\">In particular ways, Sqoop handles large objects (BLOB and CLOB columns). However, if this data is truly large, then these columns should not be fully materialized in memory for manipulation, as most columns are. Despite, their data is handled in a streaming fashion.\u00a0<\/span><br \/>\n<strong>Table 6. Sqoop Import &#8211;\u00a0Output line formatting arguments<\/strong><\/h4>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;enclosed-by &lt;char&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets a required field enclosing character<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;escaped-by &lt;char&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets the escape character<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;fields-terminated-by &lt;char&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets the field separator character<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;lines-terminated-by &lt;char&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets the end-of-line character<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;mysql-delimiters<\/span><\/td>\n<td><span style=\"font-weight: 400\">Uses MySQL\u2019s default delimiter set: fields: , lines: \\n escaped-by: \\ optionally-enclosed-by: &#8216;<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;optionally-enclosed-by &lt;char&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets a field enclosing character<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Table 7. Sqoop Import &#8211;\u00a0Input parsing arguments<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;input-enclosed-by &lt;char&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets a required field encloser<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;input-escaped-by &lt;char&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets the input escape character<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;input-fields-terminated-by &lt;char&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets the input field separator<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;input-lines-terminated-by &lt;char&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets the input end-of-line character<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;input-optionally-enclosed-by &lt;char&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets a field enclosing character<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Table 8. Sqoop Import &#8211;\u00a0Hive arguments<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hive-home &lt;dir&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Override $HIVE_HOME<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hive-import<\/span><\/td>\n<td><span style=\"font-weight: 400\">Import tables into Hive (Uses Hive\u2019s default delimiters if none are set.)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hive-overwrite<\/span><\/td>\n<td><span style=\"font-weight: 400\">Overwrite existing data in the Hive table.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;create-hive-table<\/span><\/td>\n<td><span style=\"font-weight: 400\">If set, then the job will fail if the target hive table exits. By default this property is false.<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hive-table &lt;table-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets the table name to use when importing to Hive.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hive-drop-import-delims<\/span><\/td>\n<td><span style=\"font-weight: 400\">Drops \\n, \\r, and \\01 from string fields when importing to Hive.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hive-delims-replacement<\/span><\/td>\n<td><span style=\"font-weight: 400\">Replace \\n, \\r, and \\01 from string fields with user defined string when importing to Hive.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hive-partition-key<\/span><\/td>\n<td><span style=\"font-weight: 400\">Name of a hive field to partition are sharded on<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hive-partition-value &lt;v&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">String-value that serves as partition key for this imported into hive in this job.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;map-column-hive &lt;map&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Override default mapping from SQL type to Hive type for configured columns.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>l. Importing Data Into Hive<br \/>\n<span style=\"font-weight: 400\">Uploading our data into files in <a href=\"https:\/\/data-flair.training\/blogs\/data-blocks-in-hadoop-hdfs\/\"><strong>HDFS<\/strong><\/a> is Sqoop\u2019s import tool\u2019s main function. However, if we have a<a href=\"https:\/\/data-flair.training\/blogs\/apache-hive-metastore\/\"><strong> Hive<\/strong> <strong>metastore<\/strong> <\/a>associated with our HDFS cluster, Sqoop can also import the data into Hive. It is possible by generating and executing a CREATE TABLE statement to define the data\u2019s layout in Hive. Also, it is the very simple method to import data into <a href=\"https:\/\/data-flair.training\/blogs\/apache-hive-architecture\/\"><strong>Hive<\/strong><\/a>, like adding the &#8211;hive-import option to your Sqoop command line.<\/span><\/h4>\n<h4><strong>Table 9. Sqoop Import &#8211;\u00a0HBase arguments<\/strong><\/h4>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;column-family &lt;family&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets the target column family for the import<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hbase-create-table<\/span><\/td>\n<td><span style=\"font-weight: 400\">If specified, create missing HBase tables<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hbase-row-key &lt;col&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specifies which input column to use as the row key. In case, if input table contains composite key, then &lt;col&gt; must be in the form of a\u00a0comma-separated list of composite key\u00a0attributes.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hbase-table &lt;table-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specifies an HBase table to use as the target instead of HDFS<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hbase-bulkload<\/span><\/td>\n<td><span style=\"font-weight: 400\">Enables bulk loading<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>m. Importing Data Into HBase<br \/>\n<span style=\"font-weight: 400\">Beyond <a href=\"https:\/\/data-flair.training\/blogs\/rack-awareness-hadoop-hdfs\/\"><strong>HDFS<\/strong><\/a> and <a href=\"https:\/\/data-flair.training\/blogs\/apache-hive-operators\/\"><strong>Hive<\/strong><\/a>, Sqoop supports additional import targets. Like Sqoop can also import records into a table in <a href=\"https:\/\/data-flair.training\/blogs\/hadoop-hbase-tutorial\/\"><strong>HBase<\/strong>.<\/a><\/span><\/h4>\n<h4><strong>Table 10. Sqoop Import &#8211;\u00a0Accumulo arguments<\/strong><\/h4>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-table &lt;table-nam&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specifies an Accumulo table to use as the target instead of HDFS<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-column-family &lt;family&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets the target column family for the import<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-create-table<\/span><\/td>\n<td><span style=\"font-weight: 400\">If specified, create missing Accumulo tables<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-row-key &lt;col&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Specifies which input column to use as the row key<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-visibility &lt;vis&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">(Optional) Specifies a visibility token to apply to all rows inserted into Accumulo. Default is the empty string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-batch-size &lt;size&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">(Optional) Sets the size in bytes of Accumulo\u2019s write buffer. Default is 4MB.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-max-latency &lt;ms&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">(Optional) Sets the max latency in milliseconds for the Accumulo batch writer. Default is 0.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-zookeepers &lt;host:port&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Comma-separated list of Zookeeper servers used by the Accumulo instance<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-instance &lt;table-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Name of the target Accumulo instance<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-user &lt;username&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Name of the Accumulo user to import as<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;accumulo-password &lt;password&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Password for the Accumulo user<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>n. Importing Data Into Accumulo<br \/>\n<span style=\"font-weight: 400\">Also,\u00a0in Accumulo, Sqoop supports importing records into a table.<\/span><\/h4>\n<p><strong>Table 11. Sqoop Import &#8211;\u00a0Code generation arguments<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;bindir &lt;dir&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Output directory for compiled objects<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;class-name &lt;name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Sets the generated class name. This overrides &#8211;package-name. When combined with &#8211;jar-file, sets the input class.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;jar-file &lt;file&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Disable code generation; use specified jar<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;outdir &lt;dir&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Output directory for generated code<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;package-name &lt;name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Put auto-generated classes in this package<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;map-column-java &lt;m&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Override default mapping from SQL type to Java type for configured columns.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>o. Additional Import Configuration Properties<br \/>\n<span style=\"font-weight: 400\">Some additional properties which can be configured by modifying conf\/sqoop-site.xml. However, Properties can be specified the same as in <a href=\"https:\/\/data-flair.training\/blogs\/hadoop-ecosystem-components\/\"><strong>Hadoop<\/strong> <\/a>configuration files.<\/span><\/h4>\n<h4><strong>For example:<\/strong><\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;property&gt;\r\n&lt;name&gt;property.name&lt;\/name&gt;\r\n&lt;value&gt;property.value&lt;\/value&gt;\r\n&lt;\/property&gt;<\/pre>\n<p><span style=\"font-weight: 400\">On the command line in the generic arguments,\u00a0they can also be specified.\u00a0 For example:<\/span><br \/>\nsqoop import -D property.name=property.value &#8230;<br \/>\n<strong>Table 12. Sqoop Import &#8211;\u00a0Additional import configuration properties<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Argument<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">sqoop.bigdecimal.format.string<\/span><\/td>\n<td><span style=\"font-weight: 400\">Controls how BigDecimal columns will formatted when stored as a String. A value of true (default) will use toPlainString to store them without an exponent component (0.0000001); while a value of false will use toString which may include an exponent (1E-7)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">sqoop.hbase.add.row.key<\/span><\/td>\n<td><span style=\"font-weight: 400\">When set to false (default), Sqoop will not add the column used as a row key into the row data in HBase. When set to true, the column used as a row key will be added to the row data in HBase.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Sqoop Import Example<\/h3>\n<p><span style=\"font-weight: 400\">Basically, we will understand how to use the import tool in a variety of situations by the following examples.<\/span><br \/>\n<strong>In addition, a basic import of a table named EMPLOYEES in the corp database:<\/strong><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/corp &#8211;table EMPLOYEES<br \/>\n<strong>Also, a basic import requiring a login:<\/strong><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/corp &#8211;table EMPLOYEES \\<br \/>\n&#8211;username SomeUser -P<br \/>\nEnter password: (hidden)<br \/>\n<strong>So selecting specific columns from the EMPLOYEES table:<\/strong><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/corp &#8211;table EMPLOYEES \\<br \/>\n&#8211;columns &#8220;employee_id,first_name,last_name,job_title&#8221;<br \/>\n<strong>Controlling the import parallelism (using 8 parallel tasks):<\/strong><br \/>\n<span style=\"font-weight: 400\">$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/corp &#8211;table EMPLOYEES \\<\/span><br \/>\n<span style=\"font-weight: 400\"> \u00a0\u00a0\u00a0-m 8<\/span><br \/>\n<strong>Storing data in SequenceFiles, and setting the generated class name to com.foocorp.Employee:<\/strong><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/corp &#8211;table EMPLOYEES \\<br \/>\n&#8211;class-name com.foocorp.Employee &#8211;as-sequencefile<br \/>\n<strong>Also, specifying the delimiters to use in a text-mode import:<\/strong><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/corp &#8211;table EMPLOYEES \\<br \/>\n&#8211;fields-terminated-by &#8216;\\t&#8217; &#8211;lines-terminated-by &#8216;\\n&#8217; \\<br \/>\n&#8211;optionally-enclosed-by &#8216;\\&#8221;&#8216;<br \/>\n<strong>Basically here, importing the data to Hive:<\/strong><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/corp &#8211;table EMPLOYEES \\<br \/>\n&#8211;hive-import<br \/>\n<strong>Also, here, only importing new employees:<\/strong><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/corp &#8211;table EMPLOYEES \\<br \/>\n&#8211;where &#8220;start_date &gt; &#8216;2010-01-01&#8242;&#8221;<br \/>\n<strong>Afterwards, changing the splitting column from the default:<\/strong><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/corp &#8211;table EMPLOYEES \\<br \/>\n&#8211;split-by dept_id<br \/>\n<strong>Then, we are verifying that an import was successful:<\/strong><br \/>\n$ hadoop fs -ls EMPLOYEES<br \/>\nFound 5 items<br \/>\ndrwxr-xr-x \u00a0\u00a0&#8211; someuser somegrp \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a00 2010-04-27 16:40 \/user\/someuser\/EMPLOYEES\/_logs<br \/>\n<span style=\"font-weight: 400\">-rw-r&#8211;r&#8211; \u00a0\u00a01 someuser somegrp \u00a0\u00a0\u00a02913511 2010-04-27 16:40 \/user\/someuser\/EMPLOYEES\/part-m-00000<\/span><br \/>\n-rw-r&#8211;r&#8211; \u00a0\u00a01 someuser somegrp \u00a0\u00a0\u00a01683938 2010-04-27 16:40 \/user\/someuser\/EMPLOYEES\/part-m-00001<br \/>\n-rw-r&#8211;r&#8211; \u00a0\u00a01 someuser somegrp \u00a0\u00a0\u00a07245839 2010-04-27 16:40 \/user\/someuser\/EMPLOYEES\/part-m-00002<br \/>\n-rw-r&#8211;r&#8211; \u00a0\u00a01 someuser somegrp \u00a0\u00a0\u00a07842523 2010-04-27 16:40 \/user\/someuser\/EMPLOYEES\/part-m-00003<br \/>\n$ hadoop fs -cat EMPLOYEES\/part-m-00000 | head -n 10<br \/>\n0,joe,smith,engineering<br \/>\n1,jane,doe,marketing<br \/>\n&#8230;<br \/>\n<strong>After having already imported the first 100,000 rows of a table, Here performing an incremental import of new data:<\/strong><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/somedb &#8211;table sometable \\<br \/>\n&#8211;where &#8220;id &gt; 100000&#8221; &#8211;target-dir \/incremental_dataset &#8211;append<br \/>\n<span style=\"font-weight: 400\">In the corp database, there is an import of a table named EMPLOYEES. That uses validation to validate the import. By using the table row count and the number of rows copied into<strong> HDFS.\u00a0<\/strong><\/span><br \/>\n$ sqoop import &#8211;connect jdbc:mysql:\/\/db.foo.com\/corp \\<br \/>\n&#8211;table EMPLOYEES &#8211;validate<\/p>\n<p>So, this was all in Sqoop Import tutorial. Hope you like our explanation.<\/p>\n<h3>5.Conclusion<\/h3>\n<p>Hence, in this article, we have learned the whole concept of Sqoop Import. Also, we have seen various Sqoop Import examples and Sqoop import syntax. However, if you want to ask any query regarding, please ask in the comment section below. We will definitely get back to you.<br \/>\n<strong>See also &#8211; <a href=\"https:\/\/data-flair.training\/blogs\/sqoop-import-mainframe\/\">Sqoop Mainframe Tool<\/a> <\/strong>&amp;<strong> <a href=\"https:\/\/data-flair.training\/blogs\/features-of-sqoop\/\">why Should learn Sqoop<\/a><\/strong><br \/>\n<a href=\"http:\/\/sqoop.apache.org\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>For reference<\/strong><\/a><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:2028,&quot;href&quot;:&quot;http:\\\/\\\/sqoop.apache.org&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250925155903\\\/https:\\\/\\\/sqoop.apache.org\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-10 22:16:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-13 23:03:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-17 06:30:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-20 10:18:24&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-24 02:01:17&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-27 19:00:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-30 19:52:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-02 23:02:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-06 11:12:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-11 07:39:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-14 14:00:02&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-19 20:14:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-23 07:39:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-26 22:35:53&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-02 09:53:53&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-09 06:23:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-12 18:07:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-16 05:01:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-20 15:46:49&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-23 20:42:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-02 19:22:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-06 04:01:50&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-10 04:30:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-16 11:20:34&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-20 07:53:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-23 12:38:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-31 03:58:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 07:44:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-06 10:04:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-09 14:27:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-14 16:47:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-21 15:59:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-26 17:43:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-30 00:21:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-04 07:58:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-07 14:39:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-12 19:37:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-17 18:39:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-21 10:10:02&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-26 11:21:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-01 06:33:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-05 02:07:45&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-10 06:22:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-14 04:14:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-18 03:31:28&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-21 19:29:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-25 17:04:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-29 06:32:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-02 14:31:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-06 12:01:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-09 21:39:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-13 05:53:35&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-16 16:20:34&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-07-16 16:20:34&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last article, we discussed\u00a0Sqoop Export. In this article we will discuss Sqoop import,\u00a0a\u00a0tool which we use for importing tables from RDBMS to HDFS is the Sqoop Import tool. Here, we will learn&#46;&#46;&#46;<\/p>\n","protected":false},"author":9,"featured_media":35179,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[6641,7122,13630,13632,13633,13637],"class_list":["post-6946","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sqoop","tag-importing-data-into-hive","tag-introduction-to-sqoop-import","tag-sqoop-import-arguments","tag-sqoop-import-examples","tag-sqoop-import-in-sqoop","tag-sqoop-import-syntax"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Sqoop Import- Importing Data From RDBMS to HDFS - DataFlair<\/title>\n<meta name=\"description\" content=\"Sqoop Import- Importing data from RDBMS to Hadoop HDFS Sqoop Import syntax and Examples of Sqoop Import, how to import data from RDBMS to HDFS using Sqoop\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/sqoop-import\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sqoop Import- Importing Data From RDBMS to HDFS - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Sqoop Import- Importing data from RDBMS to Hadoop HDFS Sqoop Import syntax and Examples of Sqoop Import, how to import data from RDBMS to HDFS using Sqoop\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/sqoop-import\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-01T09:26:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-07T08:16:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/02\/Sqoop-Import-Tutorial-01-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1202\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sqoop Import- Importing Data From RDBMS to HDFS - DataFlair","description":"Sqoop Import- Importing data from RDBMS to Hadoop HDFS Sqoop Import syntax and Examples of Sqoop Import, how to import data from RDBMS to HDFS using Sqoop","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/sqoop-import\/","og_locale":"en_US","og_type":"article","og_title":"Sqoop Import- Importing Data From RDBMS to HDFS - DataFlair","og_description":"Sqoop Import- Importing data from RDBMS to Hadoop HDFS Sqoop Import syntax and Examples of Sqoop Import, how to import data from RDBMS to HDFS using Sqoop","og_url":"https:\/\/data-flair.training\/blogs\/sqoop-import\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-02-01T09:26:30+00:00","article_modified_time":"2021-12-07T08:16:51+00:00","og_image":[{"width":1202,"height":630,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/02\/Sqoop-Import-Tutorial-01-1.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/sqoop-import\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/sqoop-import\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/6e11a88eea98179e861a0933f8959f8f"},"headline":"Sqoop Import- Importing Data From RDBMS to HDFS","datePublished":"2018-02-01T09:26:30+00:00","dateModified":"2021-12-07T08:16:51+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sqoop-import\/"},"wordCount":3066,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sqoop-import\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/02\/Sqoop-Import-Tutorial-01-1.jpg","keywords":["Importing Data Into Hive","Introduction to Sqoop Import","Sqoop import arguments","Sqoop Import Examples","Sqoop Import in Sqoop","Sqoop Import syntax"],"articleSection":["Sqoop Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/sqoop-import\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/sqoop-import\/","url":"https:\/\/data-flair.training\/blogs\/sqoop-import\/","name":"Sqoop Import- Importing Data From RDBMS to HDFS - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sqoop-import\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sqoop-import\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/02\/Sqoop-Import-Tutorial-01-1.jpg","datePublished":"2018-02-01T09:26:30+00:00","dateModified":"2021-12-07T08:16:51+00:00","description":"Sqoop Import- Importing data from RDBMS to Hadoop HDFS Sqoop Import syntax and Examples of Sqoop Import, how to import data from RDBMS to HDFS using Sqoop","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/sqoop-import\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/sqoop-import\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/sqoop-import\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/02\/Sqoop-Import-Tutorial-01-1.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/02\/Sqoop-Import-Tutorial-01-1.jpg","width":1202,"height":630,"caption":"Sqoop Import - Importing Data From RDBMS to HDFS"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/sqoop-import\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Sqoop Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/sqoop\/"},{"@type":"ListItem","position":3,"name":"Sqoop Import- Importing Data From RDBMS to HDFS"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/6e11a88eea98179e861a0933f8959f8f","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/54363d8635c383dcd7e3be0ef00dbeef4217c45bf323d27bc2c92366b724df08?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/54363d8635c383dcd7e3be0ef00dbeef4217c45bf323d27bc2c92366b724df08?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/54363d8635c383dcd7e3be0ef00dbeef4217c45bf323d27bc2c92366b724df08?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"At DataFlair, our team of experts is committed to offering high-quality tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We simplify learning to help you advance your career in the tech world.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam5\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/6946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=6946"}],"version-history":[{"count":9,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/6946\/revisions"}],"predecessor-version":[{"id":105369,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/6946\/revisions\/105369"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/35179"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=6946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=6946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=6946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}