Creates a data integration task.
Operation description
You must purchase DataWorks Basic Edition or a higher edition to use this feature.
This operation creates a data integration synchronization task. Parameters include the source configuration SourceDataSourceSettings and the destination configuration DestinationDataSourceSettings, the supported synchronization type MigrationType, transformation rules defined through TransformationRules for mapping operations such as adding columns and renaming tables, specific tables to synchronize and the mapping rules to apply defined in TableMappings, and task-level settings such as column mappings and scheduling configurations defined in JobSettings.
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, OSS-HDFS, OSS, MaxCompute, LogHub, StarRocks, DataHub, AnalyticDB_For_MySQL, Kafka, Hive. |
Hologres |
| Description |
string |
No |
The description of the task. |
DI Job Demo |
| SourceDataSourceType |
string |
No |
The type of the source data source. Valid values: PolarDB, MySQL, Kafka, LogHub, Hologres, Oracle, OceanBase, MongoDB, RedShift, Hive, SQLServer, Doris, ClickHouse. |
MySQL |
| ProjectId |
integer |
No |
The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the workspace management page to obtain the ID. This parameter specifies the DataWorks workspace for this API call. |
10000 |
| Name |
string |
No |
The name of the task. |
mysql_to_holo_sync_8772 |
| MigrationType |
string |
No |
The synchronization type. Valid values:
|
FullAndRealtimeIncremental |
| JobType |
string |
No |
The task type. Valid values:
|
DatabaseRealtimeMigration |
| SourceDataSourceSettings |
array<object> |
No |
The list of source data source settings. |
|
|
array<object> |
No |
A single source data source setting. |
||
| 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. |
UTF-8 |
| Timezone |
string |
No |
The time zone. |
Asia/Shanghai |
| ConnectionProperties |
string |
No |
Specify either this parameter or DataSourceName. This parameter specifies custom data source connection configuration information, including the instance ID, access identity, and instance region. This parameter supports only datasource config in instance pattern (ConnectionPropertiesMode). Different data sources have different property specifications. For more information, see Data source connection information ConnectionProperties. |
{ "instanceId": "rm-2ze09gn3x6xxx", "password": "xxxx", "database": "agent", "username": "zmtest" "regionId": "cn-beijing" } |
| DestinationDataSourceSettings |
array<object> |
No |
The list of destination data source settings. |
|
|
array<object> |
No |
A single destination data source setting. |
||
| DataSourceName |
string |
No |
The name of the data source. |
holo_datasource_1 |
| DataSourceProperties |
object |
No |
The properties of the data source. |
|
| ConnectionProperties |
string |
No |
Specify either this parameter or DataSourceName. This parameter specifies custom data source connection configuration information, including the instance ID, access identity, and instance region. This parameter supports only datasource config in instance pattern (ConnectionPropertiesMode). Different data sources have different property specifications. For more information, see Data source connection information ConnectionProperties. |
{ "instanceId": "rm-2ze09gn3x6xxx", "password": "xxxx", "database": "agent", "username": "zmtest" "regionId": "cn-beijing" } |
| ResourceSettings |
object |
No |
The resource settings. |
|
| OfflineResourceSettings |
object |
No |
The offline synchronization resource settings. |
|
| RequestedCu |
number |
No |
The number of compute units (CUs) of the data integration resource group used for offline synchronization. |
2 |
| ResourceGroupIdentifier |
string |
No |
The name of the data integration resource group used for offline synchronization. |
S_res_group_111_222 |
| RealtimeResourceSettings |
object |
No |
The real-time synchronization resource settings. |
|
| RequestedCu |
number |
No |
The number of CUs of the data integration resource group used for real-time synchronization. |
2 |
| ResourceGroupIdentifier |
string |
No |
The name of the data integration resource group used for real-time synchronization. |
S_res_group_111_222 |
| ScheduleResourceSettings |
object |
No |
The schedule resource settings. |
|
| RequestedCu |
number |
No |
The number of CUs of the scheduling resource group used for offline synchronization nodes. |
2 |
| ResourceGroupIdentifier |
string |
No |
The name of the scheduling resource group used for offline synchronization nodes. |
S_res_group_222_333 |
| TransformationRules |
array<object> |
No |
The list of synchronization object transformation rule definitions. Note
[ { "RuleName":"my_database_rename_rule", "RuleActionType":"Rename", "RuleTargetType":"Schema", "RuleExpression":"{"expression":"${srcDatasoureName}_${srcDatabaseName}"}" } ] |
|
|
object |
No |
A single synchronization object transformation rule definition. Each element represents one transformation rule. |
||
| RuleActionType |
string |
No |
The action type. Valid values:
|
Rename |
| RuleExpression |
string |
No |
The rule expression in JSON string format.
|
{ "expression": "${srcDatasoureName}_${srcDatabaseName}" } |
| RuleName |
string |
No |
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 in length. |
rename_rule_1 |
| RuleTargetType |
string |
No |
The target type on which the action is applied. Valid values:
|
Table |
| TableMappings |
array<object> |
No |
The list of synchronization object transformation mappings. Each element describes a group of source object selection rules and the transformation rules applied to that group. 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 |
Each rule represents the selection of a table to synchronize. |
||
| SourceObjectSelectionRules |
array<object> |
No |
Each rule selects a set of source objects to synchronize. Multiple rules together select a single table. |
|
|
object |
No |
Each rule selects different object types of the source objects to synchronize, such as the source database or source table. |
||
| Action |
string |
No |
The selection action. Valid values: Include and Exclude. |
Include |
| Expression |
string |
No |
The expression. |
mysql_table_1 |
| ExpressionType |
string |
No |
The expression type. Valid values: Exact and Regex. |
Exact |
| ObjectType |
string |
No |
The object type. Valid values:
|
Table |
| TransformationRules |
array<object> |
No |
The list of synchronization object transformation rule definitions. Each element represents one transformation rule. |
|
|
object |
No |
The transformation rule applied to the source objects. |
||
| RuleName |
string |
No |
The rule name. The name must be unique within the same action type and target type combination. The name cannot exceed 50 characters in length. |
rename_rule_1 |
| RuleActionType |
string |
No |
The action type. Valid values:
|
Rename |
| RuleTargetType |
string |
No |
The target type on which the action is applied. Valid values:
|
Table |
| JobSettings |
object |
No |
The task-level settings, including DDL handling policies, source-to-destination column data type mapping policies, and task runtime parameters. |
|
| ChannelSettings |
string |
No |
The channel-related task settings. You can configure special settings for specific channels. Currently supported channels include Holo2Holo (synchronization from Hologres to Hologres) and Holo2Kafka (synchronization from Hologres to Kafka).
|
{ "structInfo": "MANAGED", "storageType": "TEXTFILE", "writeMode": "APPEND", "partitionColumns": [ { "columnName": "pt", "columnType": "STRING", "comment": "" } ], "fieldDelimiter": "" } |
| ColumnDataTypeSettings |
array<object> |
No |
The column data type mapping array. Note
["ColumnDataTypeSettings":[ { "SourceDataType":"Bigint", "DestinationDataType":"Text" } ] |
|
|
object |
No |
A single column data type mapping. |
||
| DestinationDataType |
string |
No |
The destination data type, such as bigint, boolean, string, text, datetime, timestamp, decimal, or binary. The available types vary by data source type. |
text |
| SourceDataType |
string |
No |
The source data type, such as bigint, boolean, string, text, datetime, timestamp, decimal, or binary. The available types vary by data source type. |
bigint |
| CycleScheduleSettings |
object |
No |
The cycle scheduling settings. |
|
| CycleMigrationType |
string |
No |
The synchronization type that requires cycle scheduling. Valid values:
|
Full |
| ScheduleParameters |
string |
No |
The scheduling parameters. |
bizdate=$bizdate |
| DdlHandlingSettings |
array<object> |
No |
The DDL handling settings array. 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 |
|||
| Name |
string |
No |
The setting name. Valid values:
|
runtime.offline.concurrent |
| Value |
string |
No |
The setting value. |
1 |
JobName
deprecated
|
string |
No |
[Deprecated] Use the Name parameter instead. |
mysql_to_holo_sync_8772 |
| Owner |
string |
No |
The owner of the task. |
3726346 |
| FileSpec |
string |
No |
The code content 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 |
Schema of Response |
||
| Id |
integer |
The ID of the data integration task. |
11792 |
| RequestId |
string |
The request ID. You can use this ID to locate logs and troubleshoot issues. |
4F6AB6B3-41FB-5EBB-AFB2-0C98D49DA2BB |
DIJobId
deprecated
|
integer |
[Deprecated] Use the Id response parameter instead. |
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.