Updated on 2024-10-23 GMT+08:00

To OBS

Files (even in a large volume) can be batch migrated to OBS in CSV, CarbonData, or binary format.

Table 1 Parameter description

Type

Parameter

Description

Example Value

Basic parameters

Bucket Name

Name of the OBS bucket to which data is to be written

bucket_2

Write Directory

OBS directory to which data will be written. Do not add / in front of the directory name.

This parameter can be configured as a macro variable of date and time and a path name can contain multiple macro variables. When the macro variable of date and time works with a scheduled job, the incremental data can be synchronized periodically. For details, see Incremental Synchronization Using the Macro Variables of Date and Time.

NOTE:

If you have configured a macro variable of date and time and schedule a CDM job through DataArts Studio DataArts Factory, the system replaces the macro variable of date and time with (Planned start time of the data development jobOffset) rather than (Actual start time of the CDM jobOffset).

directory/

File Format

Format used for transmitting data. The CSV and JSON formats are supported for migration to tables, and the binary format is supported for file migration.

Format in which data is written. The options are as follows:
  • CSV: Data is written in CSV format, which is used for migrating data tables to files.
  • Parquet: Data is written in Parquet format, which is used for migrating data tables to files.
  • ORC: Data is written in ORC format, which is used for migrating data tables to files.
  • Binary: Files will be transferred directly. CDM writes the files without changing their format. This setting is suitable for file migration.

If data is migrated between file-related data sources, such as FTP, SFTP, HDFS, and OBS, the value of File Format must the same as the source file format.

NOTE:
  • The format can only be CSV when the source link is an MRS Hive link.
  • If the source is an FTP/SFTP server, only the binary format is supported.

CSV

Duplicate File Processing Method

This parameter is unavailable when File Format is CSV.

  • In binary and CSV file migration scenarios, files with the same name and size are duplicate files.
    • REPLACE: Replace duplicate files.
    • SKIP: Skip duplicate files.
    • ABANDON: Stop the task.
  • In the Parquet and ORC structured integration scenarios, files with the same prefix in their custom names are duplicate files.
    • REPLACE: Delete all files with the same custom file name prefix as the file to be written. For example, if the custom file name is abc, all files whose names start with abc will be deleted.
    • APPEND: No processing is performed before the file is written.
    • ABANDON: If a file with the same custom name prefix as the file to be written, an error is reported.

REPLACE

Advanced attributes

Field Delimiter

Field delimiter in the file. This parameter is not used when File Format is set to Binary.

,

File Size

This parameter is displayed only when the migration source is a database. Files are partitioned as multiple files by size so that they can be exported in proper size. The unit is MB.

1024

Encode type

Encoding type, for example, UTF-8 or GBK. This parameter is not used when File Format is set to Binary.

GBK

First Row As Header

This parameter is displayed only when data is exported from a relational database to OBS and File Format is set to CSV.

When a table is migrated to a CSV file, CDM does not migrate the heading line of the table by default. If you set this parameter to Yes, CDM writes the heading line of the table to the file.

No

Validate MD5 Value

Calculate the MD5 value of the source files and verify it with the MD5 value returned by OBS.

This parameter is displayed only when File Format is set to Binary.

If an MD5 file exists at the migration source, the system directly reads the MD5 file from the source and verifies it with the MD5 value returned by OBS.

No

Record MD5 Verification Result

This parameter is displayed only when File Format is set to Binary.

It specifies whether to write the MD5 verification result to OBS and record the verification result of each file.

No

Job Success Marker File

Whether to generate a marker file with a custom name in the destination directory after a job is executed successfully. If you do not specify a file name, this function is disabled by default.

finish.txt

Use Quote Char

This parameter is displayed only when File Format is CSV. It is used for migrating database tables to file systems.

If you set this parameter to Yes and a field in the source data table contains a field delimiter or line separator, CDM uses double quotation marks (") as the quote character to quote the field content as a whole to prevent a field delimiter from dividing a field into two fields, or a line separator from dividing a field into different lines. For example, if the hello,world field in the database is quoted, it will be exported to the CSV file as a whole.

No

Customize Hierarchical Directory

If this parameter is set to Yes, the files after migration can be stored in a custom directory. That is, only files are migrated. The directories to which the files belong are not migrated.

Yes

Hierarchical Directory

Custom storage directory for files after migration. The time macro variable is supported.

NOTE:

If the source link is a relational database link, the directory name consists of the source table name and a custom directory name. In other scenarios, the directory is a custom directory.

${dateformat(yyyy-MM-dd HH:mm:ss, -1, DAY)}

Compression Format

This parameter is unavailable when File Format is CSV.

The options are as follows:

  • NONE: Files in all formats can be transferred.
  • GZIP: Only files in .gzip format can be transferred.

NONE

Encryption

Whether to encrypt the uploaded data and the encryption mode. The options are as follows:
  • NONE: Data is written without encryption.
  • KMS: KMS in Data Encryption Workshop (DEW) is used for encryption. If KMS encryption is enabled, MD5 verification for data cannot be performed.

For details, see Encryption and Decryption During File Migration.

KMS

KMS ID

Data encryption key. This parameter is displayed when Encryption is set to KMS. Click next to the text box to select the KMS key that was created in DEW.

  • If the KMS key of the same project as that of the CDM cluster is used, you do not need to modify Project ID.
  • If the KMS key of another project is used, you need to modify Project ID.

53440ccb-3e73-4700-98b5-71ff5476e621

Project ID

ID of the project to which KMS ID belongs. The default value is the ID of the project to which the current CDM cluster belongs.

  • If KMS and the CDM cluster are in the same project, retain the default value of Project ID.
  • If KMS of another project is used, set this parameter to the ID of the project to which KMS belongs.

9bd7c4bd54e5417198f9591bef07ae67

Copy Content-Type

This parameter is displayed only when File Format is set to Binary.

Whether to copy the Content-Type attribute of the source file during object upload. This attribute is mainly used for static website migration. It cannot be written to the Archive bucket.

No

Custom File Name

This parameter is displayed only when data is exported from a relational database to OBS and File Format is set to CSV.

This parameter specifies the name of the file generated by OBS. The options are as follows:
  • String: Special characters are allowed. For example, if this parameter is set to cdm#, the name of the generated file is cdm#.csv.
  • Macro variable of time: If this parameter is set to ${timestamp()}, the name of the generated file is 1554108737.csv.
  • Macro variable of table name: If this parameter is set to ${tableName}, the name of the generated file is the source table name sqltabname.csv.
  • Macro variable of version number: If this parameter is set to ${version}, the name of the generated file is the cluster version number 2.9.2.200.csv.
  • Any combination of the character string and macro variable (macro variable of time, table name, or version number). For example, if this parameter is set to cdm#${timestamp()}_${version}, the name of the generated file is cdm#1554108737_2.9.2.200.csv.

cdm

Blob

This parameter is available only when data is exported from a relational database to OBS.

If this function is enabled, generated files are named in the following format: Root directory-Table name-Data type-Data folder format. Example: raw_schema/tbl_student/datas/tbl_student_1.csv

No

Blog File Name Extension

This parameter is available only when Folder Mode is set to Yes. It specifies the extension for the names of the files that contain custom Blob/Clog data in folder mode.

.dat/.jpg/.png