Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

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

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.

Request Parameters

Table 2 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
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

type

Yes

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 Centralized to PostgreSQL.

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:

  • 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.

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.

Table 4 Data structure description of field compare_object

Parameter

Mandatory

Type

Description

db_name

Yes

String

Database name.

table_name

No

Array of strings

List of table names in the database.

Table 5 Data structure description of field compare_object_with_token

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.

Table 6 Data structure description of field table_name_with_token

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.

Table 7 Data structure description of field compare_transformation_infos

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.

Table 8 Data structure description of field object_info

Parameter

Mandatory

Type

Description

id

No

String

  • Database name and table name. For example, the format is t_auto_db---users, where t_auto_db is the database name and users is the table name.
  • Database name, schema name, and table name. For example, the format is t_auto_db---schema1---users, where t_auto_db is the database name, schema1 is the schema name, and users is the table name.
Table 9 Data structure description of field transformation_info

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

Table 10 Response body parameters

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.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback