Search code examples
fileimportlocalrdbmssqoop

How to import data using Sqoop from RDBMS into local file system, not HDFS?


I have seen Sqoop allows one to import data from an RDBMS database into HDFS. I however want to import data into local file system folders in Linux and NOT into HDFS file system.

Is there a way to do this?


Solution

  • In Sqoop1, you can use the "-fs" option as detailed in the documentation. Here's a quick example:

    sqoop import -fs local -jt local --connect jdbc:mysql://<host>/sqoop --username sqoop --password sqoop --table tbl
    

    In Sqoop2, you will be able to choose your file system when creating a link:

    HDFS URI: file:///