Query Data Comparison Table Summary
Query table-level comparison results for a specified execution of a data comparison task. You can filter the results by database name, schema name, or table name keyword.
Request URL: /openapi/v1/comparedata/result/tableSummary
Request Method: GET
Before You Call
taskIdcan be obtained fromdatain the successful response of Create Data Comparison Task.execIdcan be obtained fromdatain the successful response of Start Data Comparison Task, or fromdata.lastExecIdreturned by Query Data Comparison Main Task Details.
Request Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| taskId | String | Yes | Data comparison main task ID. | cd-tg3isu1xgs |
| execId | Integer | Yes | Execution ID of a data comparison subtask. | 326816 |
| schemaName | String | No | Database or schema name filter. Use this parameter to narrow the query scope when a task compares multiple databases or schemas. | a2a |
| tableNameLike | String | No | Fuzzy table name filter. For PostgreSQL or SQL Server data sources, the value can usually use formats such as public.table_name or dbo.table_name. | popup |
| pageSize | Integer | No | Number of records per page. The default value is 30, and the maximum value is 100. | 30 |
| pageNumber | Integer | No | Page number. The default value starts from 1. | 1 |
Response Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| success | Boolean | Whether the request is successful. | true |
| requestId | String | Request ID, which can be used for troubleshooting and tracing. | Ta7q9BNC-jppqeSZnkkrr3TWdlmc7PAK |
| data | Object | Table-level comparison summary object. | See the field descriptions below |
data Fields
| Parameter | Type | Description | Example |
|---|---|---|---|
| taskId | String | Data comparison main task ID. | cd-tg3isu1xgs |
| execId | Integer | Data comparison execution ID in this query. | 326816 |
| totalTableCount | Integer | Total number of tables that match the filter conditions. | 1 |
| diffTableCount | Integer | Total number of tables with inconsistent data. | 1 |
| pageNumber | Integer | Returned page number. | 1 |
| pageSize | Integer | Number of records per page. | 30 |
| tableSummaries | Array | Table-level summary list. | See the field descriptions below |
tableSummaries Fields
| Parameter | Type | Description | Example |
|---|---|---|---|
| progressId | Integer | Unique identifier of a single table comparison result. Use this value to query difference details or correction SQL. | 2934527 |
| schemaName | String | Source database or schema name. | a2a |
| tableName | String | Source table name. For data sources with the database/schema/table hierarchy, this value can include schema and table names. | t_popup_control_src |
| targetSchemaName | String | Target database or schema name. | a2a |
| targetTableName | String | Target table name. | t_popup_control_target |
| status | String | Table comparison status. Valid values: Unstarted, Comparing, Failed, Skipped, and Success. | Success |
| sourceTotalRows | Long | Number of rows in the source table. | 5 |
| targetTotalRows | Long | Number of rows in the target table. | 6 |
| sourceOnlyCount | Long | Number of rows that exist only on the source side. | 3 |
| targetOnlyCount | Long | Number of rows that exist only on the target side. | 4 |
| mismatchCount | Long | Number of rows with the same primary key but different field values. | 1 |
| errorMessage | String | Error reason returned when the table status is failed or skipped. | "" |
| primaryKeyColumns | String | List of primary key or unique key column names. | control_id |
| columnsMapping | String | Source-to-target column mapping, usually returned as a JSON string. | {"control_id":"origin_id"} |
Request Example
{
"taskId": "cd-tg3isu1xgs",
"execId": 326816,
"pageNumber": 1,
"pageSize": 30
}
Successful Invocation Example
{
"success": true,
"requestId": "Ta7q9BNC-jppqeSZnkkrr3TWdlmc7PAK",
"data": {
"taskId": "cd-tg3isu1xgs",
"execId": 326816,
"totalTableCount": 1,
"diffTableCount": 1,
"pageNumber": 1,
"pageSize": 30,
"tableSummaries": [
{
"progressId": 2934527,
"schemaName": "a2a",
"tableName": "t_popup_control_src",
"targetSchemaName": "a2a",
"targetTableName": "t_popup_control_target",
"status": "Success",
"sourceTotalRows": 5,
"targetTotalRows": 6,
"sourceOnlyCount": 3,
"targetOnlyCount": 4,
"mismatchCount": 1,
"primaryKeyColumns": "control_id",
"columnsMapping": "{\"control_id\":\"origin_id\",\"popup_name\":\"popup_name\",\"app_id\":\"app_id\"}"
}
]
}
}