Create a new version of a data integration task.
Operation description
This API requires DataWorks Basic Edition or a higher edition.
This API creates a data integration synchronization task. Key parameters include
SourceDataSourceSettings,DestinationDataSourceSettings, andMigrationType. TheTransformationRulesparameter defines transformation rules for synchronized tables, such as adding columns or replacing table names. TheTableMappingsparameter specifies which tables to synchronize and their mapping rules. TheJobSettingsparameter configures task settings, including column mapping and scheduling.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DestinationDataSourceType |
string |
No |
The type of the destination data source. Valid values: |
Hologres |
| Description |
string |
No |
The description of the job. |
DI Job Demo |
| SourceDataSourceType |
string |
No |
The type of the source data source. Valid values: |
MySQL |
| ProjectId |
integer |
No |
The ID of the DataWorks workspace for this API call. To obtain the workspace ID, log on to the DataWorks console and go to the Workspace Management page. |
10000 |
| Name |
string |
No |
The name of the job. |
mysql_to_holo_sync_8772 |
| MigrationType |
string |
No |
The synchronization type. Valid values:
|
FullAndRealtimeIncremental |
| JobType |
string |
No |
The job type. Valid values:
|
DatabaseRealtimeMigration |
| SourceDataSourceSettings |
array<object> |
No |
Settings for the source data sources. |
|
|
array<object> |
No |
The settings for a single source data source. |
||
| DataSourceName |
string |
No |
The name of the data source. |
mysql_datasource_1 |
| DataSourceProperties |
object |
No |
The properties of the data source. |
|
| Encoding |
string |
No |
The database encoding format. |
UTF-8 |
| Timezone |
string |
No |
The time zone. |
Asia/Shanghai |
| ConnectionProperties |
string |
No |
Custom connection settings for the data source, such as instance ID, access credentials, and instance region. You must specify this parameter or This parameter applies only when the data source is configured in instance mode ( |
{ "instanceId": "rm-2ze09gn3x6xxx", "password": "xxxx", "database": "agent", "username": "zmtest" "regionId": "cn-beijing" } |
| DestinationDataSourceSettings |
array<object> |
No |
Settings for the destination data sources. |
|
|
array<object> |
No |
The settings for a single destination data source. |
||
| DataSourceName |
string |
No |
The name of the data source. |
holo_datasource_1 |
| DataSourceProperties |
object |
No |
The properties of the data source. |
|
| ConnectionProperties |
string |
No |
Custom connection settings for the data source, such as instance ID, access credentials, and instance region. You must specify this parameter or This parameter applies only when the data source is configured in instance mode ( |
{ "instanceId": "rm-2ze09gn3x6xxx", "password": "xxxx", "database": "agent", "username": "zmtest" "regionId": "cn-beijing" } |
| ResourceSettings |
object |
No |
The resource settings. |
|
| OfflineResourceSettings |
object |
No |
Resource settings for batch synchronization. |
|
| RequestedCu |
number |
No |
The number of CUs for the resource group for data integration that is used for batch synchronization. |
2 |
| ResourceGroupIdentifier |
string |
No |
The identifier of the resource group for data integration used for batch synchronization. |
S_res_group_111_222 |
| RealtimeResourceSettings |
object |
No |
The resources for real-time synchronization. |
|
| RequestedCu |
number |
No |
The number of CUs for the resource group for data integration that is used for real-time synchronization. |
2 |
| ResourceGroupIdentifier |
string |
No |
The identifier of the resource group for data integration used for real-time synchronization. |
S_res_group_111_222 |
| ScheduleResourceSettings |
object |
No |
The scheduling resources. |
|
| RequestedCu |
number |
No |
The number of CUs for the scheduling resource group that is used for batch synchronization jobs. |
2 |
| ResourceGroupIdentifier |
string |
No |
The identifier of the scheduling resource group used for batch synchronization jobs. |
S_res_group_222_333 |
| TransformationRules |
array<object> |
No |
A list of transformation rules for the objects to be synchronized. Note
[ { "RuleName":"my_database_rename_rule", "RuleActionType":"Rename", "RuleTargetType":"Schema", "RuleExpression":"{\"expression\":\"${srcDatasoureName}_${srcDatabaseName}\"}" } ] |
|
|
object |
No |
A single transformation rule. |
||
| RuleActionType |
string |
No |
The action type. Valid values:
|
Rename |
| RuleExpression |
string |
No |
The rule expression, specified as a JSON string.
|
{ "expression": "${srcDatasoureName}_${srcDatabaseName}" } |
| RuleName |
string |
No |
The name of the rule. The rule name must be unique for a specific action type and target object type. Maximum length: 50 characters. |
rename_rule_1 |
| RuleTargetType |
string |
No |
The type of the object to which the action applies. Valid values:
|
Table |
| TableMappings |
array<object> |
No |
Transformation mappings for the objects to be synchronized. Each mapping defines selection rules for a group of source objects and the transformation rules to apply to them. 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" } ] } ] |
|
|
array<object> |
No |
A mapping that selects a set of source objects and specifies the transformation rules to apply. |
||
| SourceObjectSelectionRules |
array<object> |
No |
Each rule can select a set of source objects to synchronize. Multiple rules combine to select one table. |
|
|
object |
No |
A rule that selects source objects of a specific type, such as a database or table. |
||
| Action |
string |
No |
The selection action. Valid values: |
Include |
| Expression |
string |
No |
The expression. |
mysql_table_1 |
| ExpressionType |
string |
No |
The expression type. Valid values: |
Exact |
| ObjectType |
string |
No |
The object type. Valid values:
|
Table |
| TransformationRules |
array<object> |
No |
The names of the transformation rules to apply to the selected objects. |
|
|
object |
No |
The transformation rule applied to the source object. |
||
| RuleName |
string |
No |
The name of the transformation rule. The rule name must be unique for a specific action type and target object type. Maximum length: 50 characters. |
rename_rule_1 |
| RuleActionType |
string |
No |
The action type. Valid values:
|
Rename |
| RuleTargetType |
string |
No |
The type of the object to which the action applies. Valid values:
|
Table |
| JobSettings |
object |
No |
The settings for the synchronization job, including DDL processing policies, data type mappings between source and destination columns, and runtime parameters. |
|
| ChannelSettings |
string |
No |
Settings for data synchronization channels. You can configure special settings for specific channels. The following channels are supported: synchronization from Hologres to Hologres (Holo2Holo) and from Hologres to Kafka (Holo2Kafka).
|
{ "structInfo": "MANAGED", "storageType": "TEXTFILE", "writeMode": "APPEND", "partitionColumns": [ { "columnName": "pt", "columnType": "STRING", "comment": "" } ], "fieldDelimiter": "" } |
| ColumnDataTypeSettings |
array<object> |
No |
Column data type mappings. Note
"ColumnDataTypeSettings":[ { "SourceDataType":"Bigint", "DestinationDataType":"Text" } ] |
|
|
object |
No |
A mapping from a source data type to a destination data type. |
||
| DestinationDataType |
string |
No |
The destination data type. For example: |
text |
| SourceDataType |
string |
No |
The source data type. For example: |
bigint |
| CycleScheduleSettings |
object |
No |
The periodic scheduling settings. |
|
| CycleMigrationType |
string |
No |
The synchronization type for periodic scheduling. Valid values:
|
Full |
| ScheduleParameters |
string |
No |
The scheduling parameters. |
bizdate=$bizdate |
| DdlHandlingSettings |
array<object> |
No |
DDL handling settings. Note
"DDLHandlingSettings":[ { "Type":"Insert", "Action":"Normal" } ] |
|
|
object |
No |
A single DDL handling setting. |
||
| Action |
string |
No |
The handling action. Valid values:
|
Critical |
| Type |
string |
No |
The DDL type. Valid values:
|
AddColumn |
| RuntimeSettings |
array<object> |
No |
The runtime settings. |
|
|
object |
No |
A runtime setting. |
||
| Name |
string |
No |
The name of the setting. Valid values:
|
runtime.offline.concurrent |
| Value |
string |
No |
The value of the setting. |
1 |
JobName
deprecated
|
string |
No |
This parameter is deprecated. Use the |
mysql_to_holo_sync_8772 |
| Owner |
string |
No |
The job owner. |
3726346 |
| FileSpec |
string |
No |
The code for a job created in script mode. |
{ "resourceSettings": { "realtimeResourceSettings": { "requestedCu": 2, "resourceGroupIdentifier": "Serverless_res_group_123_456" }, "offlineResourceSettings": { "requestedCu": 2, "resourceGroupIdentifier": "Serverless_res_group_123_456" } }, "tableMappings": [ { "sourceObjectSelectionRules": [ { "expression": "autotest_hologres", "action": "Include", "expressionType": "Exact", "objectType": "Datasource" }, { "expression": "auto_holo_2661647", "action": "Include", "expressionType": "Exact", "objectType": "Table" }, { "expression": "public", "action": "Include", "expressionType": "Exact", "objectType": "Schema" } ], "transformationRules": [ { "ruleTargetType": "Table", "ruleActionType": "SourceSchema", "ruleName": "SourceSchema_Table_BStf8aXPSCJjOWGe" }, { "ruleTargetType": "Schema", "ruleActionType": "Rename", "ruleName": "Rename_Schema_3qWNOIsljtInvKJy" }, { "ruleTargetType": "Table", "ruleActionType": "Rename", "ruleName": "Rename_Table_o3PVQq1aIKDGoVVW" }, { "ruleTargetType": "Table", "ruleActionType": "DefineDstTableSettings", "ruleName": "DefineDstTableSettings_Table_BhJltOmOCIc81fzi" }, { "ruleTargetType": "Table", "ruleActionType": "ColumnMapping", "ruleName": "ColumnMapping_Table_nP4hJPX1wh2W3fpo" } ] } ], "sourceDataSourceSettings": [ { "dataSourceProperties": { "timeZone": "Asia/Shanghai" }, "dataSourceName": "autotest_hologres" } ], "jobSettings": { "runtimeSettings": [ ], "ddlHandlingSettings": [ ], "columnDataTypeSettings": [ ], "cycleScheduleSettings": { }, "channelSettings": { "destinationChannelSettings": { "conflictMode": "replace", "dynamicColumnAction": "replay", "writeMode": "replay" }, "sourceChannelSettings": { } } }, "destinationDataSourceType": "Hologres", "transformationRules": [ { "ruleTargetType": "Table", "ruleName": "SourceSchema_Table_BStf8aXPSCJjOWGe", "ruleActionType": "SourceSchema", "ruleExpression": { "columns": [ { "name": "id", "category": "normal", "type": "BIGINT" }, { "name": "decimal", "category": "normal", "type": "DECIMAL" } ] } }, { "ruleTargetType": "Schema", "ruleName": "Rename_Schema_3qWNOIsljtInvKJy", "ruleActionType": "Rename", "ruleExpression": { "expression": "public" } }, { "ruleTargetType": "Table", "ruleName": "Rename_Table_o3PVQq1aIKDGoVVW", "ruleActionType": "Rename", "ruleExpression": { "expression": "auto_holo_2661647_dst" } }, { "ruleTargetType": "Table", "ruleName": "DefineDstTableSettings_Table_BhJltOmOCIc81fzi", "ruleActionType": "DefineDstTableSettings", "ruleExpression": { "ddlString": "BEGIN; CREATE TABLE IF NOT EXISTS public.auto_holo_2661647_dst ( id BIGINT PRIMARY KEY, "decimal" DECIMAL(38,18) ); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'time_to_live_in_seconds', '3153600000'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'orientation', 'column'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'binlog.level', 'replica'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'binlog.ttl', '2592000'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'bitmap_columns', '"text","char","varchar"'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'dictionary_encoding_columns', '"text":auto,"bytea":auto,"char":auto,"varchar":auto'); CALL SET_TABLE_PROPERTY('public.auto_holo_2661647_dst', 'distribution_key', '"id"'); COMMIT; ", "ddlType": "STRUCT" } }, { "ruleTargetType": "Table", "ruleName": "ColumnMapping_Table_nP4hJPX1wh2W3fpo", "ruleActionType": "ColumnMapping", "ruleExpression": { "columnMapping": [ { "sourceColName": "id", "dstColName": "id" }, { "sourceColName": "decimal", "dstColName": "decimal" } ] } } ], "migrationType": "FullAndRealtimeIncremental", "destinationDataSourceSettings": [ { "dataSourceProperties": { }, "dataSourceName": "autotest_hologres" } ], "sourceDataSourceType": "Hologres" } |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response schema. |
||
| Id |
integer |
The data integration job ID. |
11792 |
| RequestId |
string |
The request ID. Use this ID to locate logs and troubleshoot issues. |
4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB |
DIJobId
deprecated
|
integer |
This field is deprecated. Use the |
11792 |
Examples
Success response
JSON format
{
"Id": 11792,
"RequestId": "4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB",
"DIJobId": 11792
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.