Creating a Data-level Table Comparison Task
Function
This API is used to create a data-level table comparison task.
URI
POST /v3/{project_id}/jobs/{job_id}/table/compare
Parameter | Mandatory | Type | Description |
|---|---|---|---|
project_id | Yes | String | Project ID of a tenant in a region. For details, see Obtaining a Project ID. |
job_id | Yes | String | Task ID. |
Request Parameters
Parameter | Mandatory | Type | Description |
|---|---|---|---|
Content-Type | Yes | String | The content type. The default value is application/json. |
X-Auth-Token | Yes | String | User token obtained from IAM. |
X-Language | No | String | Request language type. Default value: en-us Enumerated values:
|
Parameter | Mandatory | Type | Description |
|---|---|---|---|
type | Yes | String | Comparison type.
|
start_time | No | String | Start time of a comparison task. The value is in timestamp format. If the value is empty, the task is started immediately. |
compare_mode | No | String | Data-level comparison mode. If this parameter is left empty, object information needs to be transferred in compare_object or compare_object_with_token. quick_comparison indicates a quick comparison. Value: quick_comparison Default value: quick_comparison |
compare_object | No | Array of objects | Data-level comparison object. For details, see Table 4. |
options | No | Map<String,String> | Configuration item for a comparison task. The value is a key-value pair. Value comparison supports the following configuration items:
Row comparison supports the following configuration items:
|
compare_object_with_token | No | Array of objects | Object for data-level comparison (Cassandra DR only, with token information). For details, see Table 5. |
compare_task_num | No | Integer | Number of comparison task threads. This parameter is available only for tasks of cloudDataGuard-cassandra and cloudDataGuard-gausscassandra-to-gausscassandra. |
compare_transformation_infos | No | Array of objects | Data filtering information. For details, see Table 7. |
proportion_value | No | Double | Sampling ratio. Set this parameter when the comparison type is set to sampling comparison. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
db_name | Yes | String | Database name. |
table_name | No | Array of strings | List of table names in the database. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
db_name | Yes | String | Database name. |
table_name_with_token | No | Array of objects | List of tables (with tokens) in the database. For details, see Table 6. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
table_name | Yes | String | Table name. |
min_token | No | String | Min token of a table. |
max_token | No | String | Max token of a table. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
object_info | Yes | Array of objects | Object information. For details, see Table 8. |
transformation_info | Yes | Object | Data filtering information. For details, see Table 9. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
id | No | String |
|
Parameter | Mandatory | Type | Description |
|---|---|---|---|
transformation_type | Yes | String | Processing rule. The value is contentConditionalFilte. |
value | Yes | String | Filtering condition. The value is an SQL condition statement, for example, id>100. The value contains a maximum of 256 characters. |
Response Parameters
Status code: 202
Parameter | Type | Description |
|---|---|---|
id | String | ID of a comparison task. |
Example Request
- Creating a data-level sampling comparison task
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/{job_id}/table/compare { "compare_object" : [ { "db_name" : "t_auto_db", "table_name" : [ ] } ], "options" : { }, "proportion_value" : 20.1, "type" : "random" } - Creating a data-level dynamic value comparison task
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/{job_id}/table/compare { "compare_object" : [ { "db_name" : "t_auto_db", "table_name" : [ ] } ], "options" : { "contentCompareType" : "dynamic" }, "start_time" : "1809366237000", "type" : "contents" } - Creating a row comparison task with data filtering enabled
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/{job_id}/table/compare { "compare_object" : [ ], "compare_transformation_infos" : [ { "object_info" : [ { "id" : "t_auto_db-*-*-test-*-*-users" } ], "transformation_info" : { "transformationType" : "contentConditionalFilter", "value" : "id>100" } } ], "type" : "lines" }
Example Response
Status code: 202
OK
{
"id" : "6a0deb4a-ce39-449b-8c49-e0eed954c155"
} Status code: 400
Bad Request
{
"error_code" : "DRS.M00202",
"error_msg" : "The value of jobId is invalid."
} Status Code
Status Code | Description |
|---|---|
202 | OK |
400 | Bad Request |
Error Code
For details, see Error Code.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.

