Sqoop command introduction

In my last article I explained how we can use import command. In that article I have explained the use of - -m , - - target-dir and - - where using import command. In this article I am going to explore more option of import command in SQOOP.

Import Command with warehouse-dir

In my last article I have explained how we can use - -target-dir to import data in particular directory. But the limitation of target-dir is that the given directory which we will pass it to the argument must not create earlier. If this directory already created then an error will be thrown by the SQOOP Tool.

But when we pass particular directory with –warehouse-dir it will treat directory as parent directory and create sub directory inside the parent directory with the name of table name.

Warehourse-dir Example

	Import with warehouse
		Figure 1
		

So if you -ls this directory then you will get the resultwithwarehouse as a parent directory and emp which is the table name as a sub directory.

	listing of hdfs
		Figure 2
		

Now run this import command with different table name then a new subdirectory will be created and data will be imported in it.

If we want we can also pass the sub directory with parent directory in the following manner:-

	sqoop with sub directory
		Figure 3
		

Now we have already created result with warehouse parent directory. A sub directory with name of employee will be created in the parent directory and with the name of emp a sub directory will be created inside employee sub directory and data will be imported in it.

Email Address

For any query you can send mail at info@techaltum.com
Thanks