2.2.6. SFTP Connector

The SFTP connector supports moving data between a Secure File Transfer Protocol (SFTP) server and other supported Sqoop2 connectors.

Currently only the TO direction is supported to write records to an SFTP server. A FROM connector is pending (SQOOP-2218).

2.2.6.1. Usage

Before executing a Sqoop2 job with the SFTP connector, set mapreduce.task.classpath.user.precedence to true in the Hadoop cluster config, for example:

<property>
  <name>mapreduce.task.classpath.user.precedence</name>
  <value>true</value>
</property>

This is required since the SFTP connector uses the JSch library (http://www.jcraft.com/jsch/) to provide SFTP functionality. Unfortunately Hadoop currently ships with an earlier version of this library which causes an issue with some SFTP servers. Setting this property ensures that the current version of the library packaged with this connector will appear first in the classpath.

To use the SFTP Connector, create a link for the connector and a job that uses the link.

2.2.6.1.2. TO Job Configuration

Inputs associated with the Job configuration for the TO direction include:

Input Type Description Example
Output directory String The location on the SFTP server that the connector will write files to. Required uploads

2.2.6.1.2.1. Notes

  1. The output directory value needs to be an existing directory on the SFTP server.

2.2.6.2. Loader

During the loading phase, the connector will create uniquely named files in the output directory for each partition of data received from the FROM connector.