Use Loader to import data from an SFTP server to Spark.
Setting Basic Job Information
Parameter |
Description |
Example Value |
---|---|---|
Name |
Name of the SFTP server connection |
sftpName |
SFTP Server IP Address |
IP address of the SFTP server |
10.16.0.1 |
SFTP Server Port |
Port number of the SFTP server |
22 |
SFTP Username |
Username for accessing the SFTP server |
root |
SFTP Password |
Password for accessing the SFTP server |
xxxx |
SFTP Public Key |
Public key of the SFTP server |
OdDt/yn...etM |
When multiple SFTP servers are configured, the data in the specified directories of the servers is imported to Spark.
Setting Data Source Information
Parameter |
Description |
Example Value |
---|---|---|
Input Path |
Input path or name of the source file on an SFTP server. If multiple SFTP server IP addresses are configured for the connector, you can set this parameter to multiple input paths separated with semicolons (;). Ensure that the number of input paths is the same as that of SFTP servers configured for the connector. NOTE:
You can use macros to define path parameters. For details, see Using Macro Definitions in Configuration Items. |
/opt/tempfile;/opt |
File Split Type |
Indicates whether to split source files by file name or size. The files obtained after the splitting are used as the input files of each Map in the MapReduce task for data import.
|
FILE |
Filter Type |
File filter condition. This parameter is used when Path Filter or File Filter is set.
|
WILDCARD |
Path Filter |
Wildcard or regular expression for filtering the directories in the input path of the source files. This parameter is used when Filter Type is set. Input Path is not used for filtering. Use semicolons (;) to separate the path filters on multiple servers and use commas (,) to separate the filter conditions of each server. If this parameter is left empty, directories are not filtered.
For example, when Filter type is set to WILDCARD, set the parameter to *; when Filter type is set to REGEX, set the parameter to \\.*. |
1*,2*;1* |
File Filter |
Wildcard or regular expression for filtering the file names of the source files. This parameter is used when Filter Type is set. Use semicolons (;) to separate the path filters on multiple servers and use commas (,) to separate the filter conditions of each server. This parameter cannot be left blank.
For example, when Filter type is set to WILDCARD, set the parameter to *; when Filter type is set to REGEX, set the parameter to \\.*. |
*.txt,*.csv;*.txt |
Encoding Type |
Source file encoding format, for example, UTF-8 and GBK. This parameter can be set only in text file import. |
UTF-8 |
Suffix |
File name extension added to a source file after the source file is imported. If this parameter is empty, no file name extension is added to the source file. This parameter is valid only when the data source is a file system. You are advised to set this parameter in incremental data import. For example, if the parameter is set to .txt and the source file is test-loader.csv, the source file name is test-loader.csv.txt after export. |
.log |
Compression |
Indicates whether to enable compressed transmission when SFTP is used to export data.
|
true |
Setting Data Transformation
Input Type |
Output Type |
---|---|
CSV File Input |
Spark Output |
HTML Input |
Spark Output |
Fixed File Input |
Spark Output |
Setting Data Storage Information and Executing the Job
Parameter |
Description |
Example Value |
---|---|---|
Output Directory |
Specifies the directory for storing data imported into Spark. NOTE:
You can use macros to define path parameters. For details, see Using Macro Definitions in Configuration Items. |
/opt/tempfile |
Extractors |
Number of Maps that are started at the same time in a MapReduce task of a data configuration operation. The value must be less than or equal to 3000. You are advised to set the parameter to the maximum number of connections on the SFTP server. |
20 |
Extractor Size |
Spark does not support this parameter. Please set Extractors. |
- |
Checking the Job Execution Result