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.
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.
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.
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:-
Now we have already created resultwithwarehouse 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.
For any query you can send mail at email@example.com Thanks