Data export using Sqoop

The working of the Sqoop export tool is very much similar to the Sqoop import tool. When the export command is executed, Sqoop gathers the metadata required for the export function and then churns the appropriate map tasks depending on the size and nature of the data; then it transfers the data to the appropriate RDBMS. It does use the available connectors to actually persist/write the data to the database. Some connectors have a concept of staging table where data is first collected (staged) and then actually moved to the target database. This staged table approach is good in one aspect where there is a failure while export and because of this staged data availability, the whole job doesn't have to be redone, rather it could very well be reused.

The following figure (Figure 07 - our interpretation of Sqoop Export inspired from Apache Sqoop blogs), very much similar to Sqoop import (Figure 06) gives the inner working of Sqoop when exporting data using Sqoop:

Figure 07: Working of Sqoop Export

Our use case does not demand showing the export function of Sqoop; however, we will just give you the important Sqoop export commands in the next sections of this chapter so that you as a reader have a complete understanding of Sqoop.