Updated on 2024-05-27 GMT+08:00

Querying Data-level Table Comparison Tasks

Function

This API is used to query data-level table comparison tasks.

URI

GET /v3/{project_id}/jobs/{job_id}/table/compare

Table 1 Path parameters

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.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Number of items displayed per page.

Default value: 1000

offset

No

Integer

Offset, which is the position where the query starts. The value must be no less than 0.

Default value: 0

Request Parameters

Table 3 Request header 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:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

compare_jobs

Array of objects

Table comparison task details.

For details, see Table 5.

count

Long

Number of tasks.

Table 5 Data structure description of field compare_jobs

Parameter

Type

Description

id

String

ID of a comparison task.

type

String

Comparison type.

  • lines: row comparison.
  • contents: value comparison.
  • random: sampling comparison. This function is available only for tasks from GaussDB Distributed to GaussDB Distributed, GaussDB Distributed to PostgreSQL, and GaussDB Primary/Standby to PostgreSQL.

options

Map<String,String>

Configuration item for a comparison task. The value is a key-value pair. Value comparison supports the following configuration items:

  • Comparison method. The key is contentCompareType. The value dynamic indicates a dynamic comparison, and the value static indicates a static comparison.
  • LOB comparison policy. The key is lobCompare. The value ignore indicates LOB data is ignored, and the value length indicates that LOB length is compared.

Row comparison supports the following configuration items:

  • Comparison policy configuration, which is applicable to many-to-one synchronization. The key is comparePolicy. The value normal indicates a one-to-one comparison, and the value manyToOne indicates a many-to-one comparison.

start_time

String

Start time in UTC format, for example, 2020-09-01T18:50:20Z.

end_time

String

End time in UTC format, for example, 2020-09-01T18:50:20Z.

status

String

Status of a comparison task.

  • RUNNING: The comparison task is in progress.
  • WAITING_FOR_RUNNING: The comparison task is waiting to be started.
  • SUCCESSFUL: The comparison task is complete.
  • FAILED: The comparison task failed.
  • CANCELLED: The comparison task is canceled.
  • TIMEOUT_INTERRUPT: The comparison task timed out.
  • FULL_DOING: Full verification is in progress.
  • INCRE_DOING: Incremental verification is in progress.

export_status

String

Status of the exported comparison result.

  • INIT: indicates that the comparison result export is in the initial status.
  • EXPORTING: indicates that the comparison result is being exported.
  • EXPORT_COMPLETE: indicates that the comparison result is exported.
  • EXPORT_COMMON_FAILED: indicates that the comparison result fails to be exported.

report_remain_seconds

Long

Remaining validity period of the exported comparison result.

compare_job_tag

Map<String,String>

Tag of a comparison task. This parameter is returned only when a comparison policy is configured.

proportion_value

String

Sampling ratio. Set this parameter when the comparison type is set to sampling comparison.

Example Request

Querying data-level table comparison tasks

https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/{job_id}/table/compare?offset=0&limit=10

Example Response

Status code: 200

OK

{
  "count" : 2,
  "compareJobs" : [ {
    "id" : "48c6acb4-1473-48fd-8676-df3705758c27",
    "type" : "lines",
    "options" : { },
    "status" : "SUCCESSFUL",
    "start_time" : "2024-03-14T06:30:14Z",
    "end_time" : "2024-03-14T06:31:14Z",
    "export_status" : "INIT",
    "report_remain_seconds" : -1
  }, {
    "id" : "9e01bd96-e627-4538-a545-5f31d1c88e94",
    "type" : "lines",
    "options" : { },
    "status" : "SUCCESSFUL",
    "start_time" : "2024-03-14T06:30:14Z",
    "end_time" : "2024-03-14T06:31:14Z",
    "export_status" : "INIT",
    "report_remain_seconds" : -1,
    "proportion_value" : "1"
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "DRS.M00202",
  "error_msg" : "The value of jobId is invalid."
}

Status Code

Status Code

Description

200

OK

400

Bad Request

Error Code

For details, see Error Code.