Skip to main content

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

Request Parameters

ParameterTypeRequiredDescriptionExample
taskIdStringYesData comparison main task ID.cd-tg3isu1xgs
execIdIntegerYesExecution ID of a data comparison subtask.326816
schemaNameStringNoDatabase or schema name filter. Use this parameter to narrow the query scope when a task compares multiple databases or schemas.a2a
tableNameLikeStringNoFuzzy 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
pageSizeIntegerNoNumber of records per page. The default value is 30, and the maximum value is 100.30
pageNumberIntegerNoPage number. The default value starts from 1.1

Response Parameters

ParameterTypeDescriptionExample
successBooleanWhether the request is successful.true
requestIdStringRequest ID, which can be used for troubleshooting and tracing.Ta7q9BNC-jppqeSZnkkrr3TWdlmc7PAK
dataObjectTable-level comparison summary object.See the field descriptions below

data Fields

ParameterTypeDescriptionExample
taskIdStringData comparison main task ID.cd-tg3isu1xgs
execIdIntegerData comparison execution ID in this query.326816
totalTableCountIntegerTotal number of tables that match the filter conditions.1
diffTableCountIntegerTotal number of tables with inconsistent data.1
pageNumberIntegerReturned page number.1
pageSizeIntegerNumber of records per page.30
tableSummariesArrayTable-level summary list.See the field descriptions below

tableSummaries Fields

ParameterTypeDescriptionExample
progressIdIntegerUnique identifier of a single table comparison result. Use this value to query difference details or correction SQL.2934527
schemaNameStringSource database or schema name.a2a
tableNameStringSource table name. For data sources with the database/schema/table hierarchy, this value can include schema and table names.t_popup_control_src
targetSchemaNameStringTarget database or schema name.a2a
targetTableNameStringTarget table name.t_popup_control_target
statusStringTable comparison status. Valid values: Unstarted, Comparing, Failed, Skipped, and Success.Success
sourceTotalRowsLongNumber of rows in the source table.5
targetTotalRowsLongNumber of rows in the target table.6
sourceOnlyCountLongNumber of rows that exist only on the source side.3
targetOnlyCountLongNumber of rows that exist only on the target side.4
mismatchCountLongNumber of rows with the same primary key but different field values.1
errorMessageStringError reason returned when the table status is failed or skipped.""
primaryKeyColumnsStringList of primary key or unique key column names.control_id
columnsMappingStringSource-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\"}"
}
]
}
}