Sqoop Export

Similar to the Sqoop import function, Sqoop also can export data from HDFS to a relational database. The precondition, however, is that the table must be already existing in the target database:

sqoop export (generic-args) (export-args)

sqoop export --connect jdbc:postgresql://<DB_SERVER_ADDRESS>/<DB_NAME>?schema=<SCHEMA> --table <TABLE_NAME> --m 1 --username <DB_USER_NAME> --password <DB_PASSWORD> --export-dir <HDFS_SOURCE_PATH>

Here <HDFS_SOURCE_PATH> is the Hadoop filesystem path as a source that would be exported to a target database:

Figure 19: Export to RDBMS from HDFS using Sqoop Export
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.80.34