All Products
Search
Document Center

DataWorks:CreateDIJob

Last Updated:Dec 19, 2025

Creates a new-version synchronization task.

Operation description

  • This API operation is available for all DataWorks editions.
  • You can call this API operation to create a synchronization task. When you call this API operation, you must configure parameters such as SourceDataSourceSettings, DestinationDataSourceSettings, MigrationType, TransformationRules, TableMappings, and JobSettings. The SourceDataSourceSettings parameter defines the settings related to the source. The DestinationDataSourceSettings parameter defines the settings related to the destination. The MigrationType parameter defines the synchronization task type. The TransformationRules parameter defines the transformation rules for objects involved in the synchronization task. The TableMappings parameter defines the mappings between rules used to select synchronization objects in the source and transformation rules applied to the selected synchronization objects. The JobSettings parameter defines the settings for the dimension of the synchronization task, including policies for data type mappings between source fields and destination fields and settings for periodic scheduling.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
DestinationDataSourceTypestringYes

The destination type. Valid values: Hologres, OSS-HDFS, OSS, MaxCompute, LogHub, StarRocks, DataHub, AnalyticDB for MySQL, Kafka, and Hive.

Hologres
DescriptionstringNo

The task description.

The description of the synchronization task.
SourceDataSourceTypestringYes

The source type. Valid values: PolarDB, MySQL, Kafka, LogHub, Hologres, Oracle, OceanBase, MongoDB, Redshift, Hive, SQL Server, Doris, and ClickHouse.

MySQL
ProjectIdlongNo

The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to obtain the ID.

You must configure this parameter to specify the DataWorks workspace to which the API operation is applied.

10000
NamestringNo

The name of the synchronization task.

mysql_to_holo_sync_8772
MigrationTypestringYes

The synchronization type. Valid values:

  • FullAndRealtimeIncremental
  • RealtimeIncremental
  • Full
  • OfflineIncremental
  • FullAndOfflineIncremental
FullAndRealtimeIncremental
JobTypestringNo

The type of the synchronization task. Valid values:

  • DatabaseRealtimeMigration: A real-time synchronization task used to synchronize only full data, only incremental data, or full and incremental data in multiple tables of multiple databases in the source.
  • DatabaseOfflineMigration: A batch synchronization task used to synchronize only full data, only incremental data, or full and incremental data in multiple tables of multiple databases in the source.
  • SingleTableRealtimeMigration: A real-time synchronization task used to synchronize data only in a single table in the source.
DatabaseRealtimeMigration
SourceDataSourceSettingsarray<object>Yes

The list of source data source settings.

objectYes

A single source data source setting.

DataSourceNamestringNo

The data source name.

mysql_datasource_1
DataSourcePropertiesobjectNo

The data source properties.

EncodingstringNo

The database encoding.

UTF-8
TimezonestringNo

The time zone.

GMT+8
DestinationDataSourceSettingsarray<object>Yes

The list of destination data source settings.

objectYes

A single destination data source setting.

DataSourceNamestringNo

The data source name.

holo_datasource_1
ResourceSettingsobjectYes

The resource settings.

OfflineResourceSettingsobjectNo

The batch synchronization resources.

RequestedCudoubleNo

The CU of the Data Integration resource group used for batch synchronization.

2.0
ResourceGroupIdentifierstringNo

The name of the Data Integration resource group used for batch synchronization.

S_res_group_111_222
RealtimeResourceSettingsobjectNo

The real-time synchronization resources.

RequestedCudoubleNo

The CU of the Data Integration resource group used for real-time synchronization.

2.0
ResourceGroupIdentifierstringNo

The name of the Data Integration resource group used for real-time synchronization.

S_res_group_111_222
ScheduleResourceSettingsobjectNo

The scheduling resources.

RequestedCudoubleNo

The CU of the scheduling resource group for batch synchronization tasks.

2.0
ResourceGroupIdentifierstringNo

The name of the scheduling resource group for batch synchronization tasks.

S_res_group_235454102432001_1579085295030
TransformationRulesarray<object>No

The list of synchronization object transformation rule definitions.

Note [ { "RuleName":"my_database_rename_rule", "RuleActionType":"Rename", "RuleTargetType":"Schema", "RuleExpression":"{"expression":"${srcDatasoureName}_${srcDatabaseName}"}" } ]
objectNo

A single synchronization object transformation rule definition.

RuleActionTypestringNo

The action type. Valid values:

  • DefinePrimaryKey
  • Rename
  • AddColumn
  • HandleDml
  • DefineIncrementalCondition
  • DefineCycleScheduleSettings
  • DefinePartitionKey
Rename
RuleExpressionstringNo

The rule expression in JSON string format.

  1. Rename rule
  • Example: {"expression":"${srcDatasourceName}_${srcDatabaseName}_0922" }
  • expression: The rename transformation expression. Supported variables include: ${srcDatasourceName} (source data source name), ${srcDatabaseName} (source database name), and ${srcTableName} (source table name).
  1. AddColumn rule
  • Example: {"columns":[{"columnName":"my_add_column","columnValueType":"Constant","columnValue":"123"}]}
  • If not specified, the default behavior is to not add columns.
  • columnName: The name of the column to add.
  • columnValueType: The value type of the column to add. Valid values: Constant and Variable.
  • columnValue: The value of the column to add. When columnValueType is set to Constant, the value is a custom constant of the string type. When columnValueType is set to Variable, the value is a built-in variable. Built-in variables include: EXECUTE_TIME (execution time, long type), DB_NAME_SRC (source database name, string type), DATASOURCE_NAME_SRC (source data source name, string type), TABLE_NAME_SRC (source table name, string type), DB_NAME_DEST (destination database name, string type), DATASOURCE_NAME_DEST (destination data source name, string type), TABLE_NAME_DEST (destination table name, string type), and DB_NAME_SRC_TRANSED (transformed source database name, string type).
  1. DefinePrimaryKey
  • Example: {"columns":["ukcolumn1","ukcolumn2"]}
  • If not specified, the source primary key columns are used by default.
  • When the destination table already exists: Data Integration does not modify the destination table structure. If the specified primary key columns are not in the destination table, the task fails to start.
  • When the destination table is auto-created: Data Integration automatically creates the destination table structure with the defined primary key columns. If the specified primary key columns are not in the destination table, the task fails to start.
  1. HandleDml rule
  • Example of a rule used to process DML messages: {"dmlPolicies":[{"dmlType":"Delete","dmlAction":"Filter","filterCondition":"id > 1"}]}.
  • If not specified, the default rule is Normal for Insert, Update, and Delete.
  • dmlType: The DML operation type. Valid values: Insert, Update, and Delete.
  • dmlAction: The DML handling policy. Valid values: Normal, Ignore, Filter (conditional processing, used when dmlType is Update or Delete), and LogicalDelete.
  • filterCondition: The DML filter condition. This parameter is used when dmlAction is set to Filter.
  1. DefineIncrementalCondition
  • Example: {"where":"id > 0"}
  • Specifies the incremental filter condition.
  1. DefineCycleScheduleSettings
  • Example: {"cronExpress":" * * * * * *", "cycleType":"1"}
  • Specifies the scheduled task parameters.
  1. DefinePartitionKey
  • Example: {"columns":["id"]}
  • Specifies the partition key.
{"expression":"${srcDatasoureName}_${srcDatabaseName}"}
RuleNamestringNo

The rule name. When the action type and target type are the same, the rule name must be unique. The name cannot exceed 50 characters.

rename_rule_1
RuleTargetTypestringNo

The target type for the action. Valid values:

  • Table
  • Schema
  • Database
Table
TableMappingsarray<object>Yes

The list of synchronization object transformation mappings. Each element describes a set of source object selection rules and the transformation rules applied to those objects.

Note [ { "SourceObjectSelectionRules":[ { "ObjectType":"Database", "Action":"Include", "ExpressionType":"Exact", "Expression":"biz_db" }, { "ObjectType":"Schema", "Action":"Include", "ExpressionType":"Exact", "Expression":"s1" }, { "ObjectType":"Table", "Action":"Include", "ExpressionType":"Exact", "Expression":"table1" } ], "TransformationRuleNames":[ { "RuleName":"my_database_rename_rule", "RuleActionType":"Rename", "RuleTargetType":"Schema" } ] } ]
objectYes

Each rule represents the selection of a table to synchronize.

SourceObjectSelectionRulesarray<object>No

Each rule can select a set of source objects to synchronize. Multiple rules together select a table.

objectNo

Each rule can select different object types from the source, such as source databases and source tables.

ActionstringNo

The selection action. Valid values: Include and Exclude.

Include
ExpressionstringNo

The expression.

mysql_table_1
ExpressionTypestringNo

The expression type. Valid values: Exact and Regex.

Exact
ObjectTypestringNo

The object type. Valid values:

  • Table
  • Schema
  • Database
Table
TransformationRulesarray<object>No

The list of synchronization object transformation rule definitions. Each element represents a single transformation rule definition.

objectNo

The transformation rules applied to source objects.

RuleNamestringNo

The rule name. The rule name must be unique for a given combination of action type and target type. The name cannot exceed 50 characters.

rename_rule_1
RuleActionTypestringNo

The action type. Valid values:

  • DefinePrimaryKey
  • Rename
  • AddColumn
  • HandleDml
  • DefineIncrementalCondition
  • DefineCycleScheduleSettings
  • DefinePartitionKey
Rename
RuleTargetTypestringNo

The target type for the action. Valid values:

  • Table
  • Schema
  • Database
Table
JobSettingsobjectNo

The task-level settings, including DDL handling policies, column data type mapping between source and destination, and runtime parameters.

ChannelSettingsstringNo

The channel-specific settings. You can configure special settings for specific channels. Currently supported: Holo2Holo (Hologres to Hologres) and Holo2Kafka (Hologres to Kafka).

  1. Holo2Kafka
  • Example: {"destinationChannelSettings":{"kafkaClientProperties":[{"key":"linger.ms","value":"100"}],"keyColumns":["col3"],"writeMode":"canal"}} kafkaClientProperties: Kafka producer parameters used when writing to Kafka.
  • keyColumns: The columns to write to Kafka.
  • writeMode: The Kafka write format. Valid values: json and canal.
  1. Holo2Holo
  • Example: {"destinationChannelSettings":{"conflictMode":"replace","dynamicColumnAction":"replay","writeMode":"replay"}}
  • conflictMode: The conflict handling policy when writing to Hologres. Valid values: replace (overwrite) and ignore.
  • writeMode: The write mode for Hologres. Valid values: replay and insert.
  • dynamicColumnAction: The dynamic column handling mode when writing to Hologres. Valid values: replay, insert, and ignore.
{"structInfo":"MANAGED","storageType":"TEXTFILE","writeMode":"APPEND","partitionColumns":[{"columnName":"pt","columnType":"STRING","comment":""}],"fieldDelimiter":""}
ColumnDataTypeSettingsarray<object>No

The array of column type mappings.

Note ["ColumnDataTypeSettings":[ { "SourceDataType":"Bigint", "DestinationDataType":"Text" } ]
objectNo

A single column type mapping.

DestinationDataTypestringNo

The destination type, such as bigint, boolean, string, text, datetime, timestamp, decimal, or binary. Different data sources may have different types.

text
SourceDataTypestringNo

The source type, such as bigint, boolean, string, text, datetime, timestamp, decimal, or binary. Different data sources may have different types.

bigint
CycleScheduleSettingsobjectNo

The scheduled task settings.

CycleMigrationTypestringNo

The synchronization type that requires scheduling. Valid values:

  • Full: Full synchronization
  • OfflineIncremental: Batch incremental synchronization
Full
ScheduleParametersstringNo

The scheduling parameters.

bizdate=$bizdate
DdlHandlingSettingsarray<object>No

The array of DDL handling settings.

Note ["DDLHandlingSettings":[ { "Type":"Insert", "Action":"Normal" } ]
objectNo

A single DDL handling setting.

ActionstringNo

Valid values:

  • Ignore
  • Critical: Fail the task
  • Normal
Critical
TypestringNo

The DDL type. Valid values:

  • RenameColumn
  • ModifyColumn
  • CreateTable
  • TruncateTable
  • DropTable
  • DropColumn
  • AddColumn
AddColumn
RuntimeSettingsarray<object>No

The runtime settings.

objectNo
NamestringNo

The setting name. Valid values:

  • src.offline.datasource.max.connection: Specifies the maximum number of connections that are allowed for reading data from the source of a batch synchronization task.
  • dst.offline.truncate: Specifies whether to clear the destination table before data writing.
  • runtime.offline.speed.limit.enable: Specifies whether throttling is enabled for a batch synchronization task.
  • runtime.offline.concurrent: Specifies the maximum number of parallel threads that are allowed for a batch synchronization task.
  • runtime.enable.auto.create.schema: Specifies whether schemas are automatically created in the destination of a synchronization task.
  • runtime.realtime.concurrent: Specifies the maximum number of parallel threads that are allowed for a real-time synchronization task.
  • runtime.realtime.failover.minute.dataxcdc: Specifies the maximum waiting duration before a synchronization task retries the next restart if the previous restart fails after failover occurs. Unit: minutes.
  • runtime.realtime.failover.times.dataxcdc: Specifies the maximum number of failures that are allowed for restarting a synchronization task after failovers occur.
runtime.offline.concurrent
ValuestringNo

The setting value.

1
JobNamedeprecatedstringNo

This parameter is deprecated and is replaced by the Name parameter.

mysql_to_holo_sync_8772
OwnerstringNo

The task owner.

3726346

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

Idlong

The ID of the synchronization task.

11792
RequestIdstring

The request ID. You can use the ID to query logs and troubleshoot issues.

4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB
DIJobIddeprecatedlong

This parameter is deprecated and is replaced by the Id parameter.

11792

Examples

Sample success responses

JSONformat

{
  "Id": 11792,
  "RequestId": "4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB",
  "DIJobId": 11792
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-03-27The request parameters of the API has changedView Change Details
2025-01-06The request parameters of the API has changed. The response structure of the API has changedView Change Details