This topic describes the background information, usage limitations, and configuration methods of the matching rules for the validation object.
Background information
When you create a data validation task, you can specify the validation objects by using one of the following methods: specifying objects, importing a CSV file, or matching rules. When you use the matching rule method, you can write wildcard rules to specify the validation objects. You can also configure the mapping logic between objects in the source and destination. By using simple and efficient string matching capabilities, you can reduce the configuration difficulty when there are many objects to be validated.
The following table describes the supported wildcard rules and their requirements.
| Category | Supported wildcard rule | Example | Description |
|---|---|---|---|
| Source/destination database tables match | *.* | kd_test*.person* | Validates all tables in databases starting with kd_test in the source and destination that start with person. |
| Source/destination database tables match | *.<Source table> | kd_test*.person | Validates all tables named person in databases starting with kd_test in the source and destination. |
| Source/destination database tables match | <Source database>.* | kd_test.person* | Validates all tables in the database named kd_test in the source and destination that start with person. |
| Source/destination database tables match | <Source database>.<Source table> | kd_test.person | Validates the table named person in the database named kd_test in the source and destination. |
| Source/destination database tables renamed | <Source database>.<Source table>=<Destination database>.<Destination table> | kd_test.person=kd_test_new.person_new | Validates the table named person in the database named kd_test in the source and the table named person_new in the database named kd_test_new in the destination. |
| Source/destination database tables renamed | <Source database>.*=<Destination database>.* | kd_test.person*=kd_test_new.person* | Validates all tables in the database named kd_test in the source that start with person with all tables in the database named kd_test_new in the destination that start with person. |
| Source/destination database tables renamed | *.<Source table>=*.<Destination table> | kd_test*.person=kd_test_new*.person_new | Validates all tables named person in databases starting with kd_test in the source with all tables named person_new in databases starting with kd_test_new in the destination. |
| Table aggregation | <Source database>.*=<Destination database>.<Destination table> | kd_test.person*=kd_test.person_all | Validates all tables in the database named kd_test in the source that start with person with the table named person_all in the database named kd_test in the destination. |
| Table aggregation | *.<Source table>=<Destination database>.<Destination table> | kd_test*.person=kd_test_all.person | Validates all tables named person in databases starting with kd_test in the source with the table named person in the database named kd_test_all in the destination. |
| Table aggregation | *.*=<Destination database>.<Destination table> | kd_test*.person*=kd_test_all.person_all | Validates all tables in databases starting with kd_test in the source that start with person with the table named person_all in the database named kd_test_all in the destination. |
| Table aggregation | *.*=<Destination database>.* | kd_test*.person*=kd_test_all.person* | Validates all tables in databases starting with kd_test in the source that start with person with all tables in the database named kd_test_all in the destination that start with person. |
| Table aggregation | *.*=*.<Destination table> | kd_test*.person*=kd_test*.person_all | Validates all tables in databases starting with kd_test in the source that start with person with all tables named person_all in databases starting with kd_test in the destination. |
The following rules apply to the wildcard rules:
The wildcard rules cannot be used for both the destination database name and the destination table name. For example,
kd_test*.person*=kd_test*.person*.If both the source and destination databases are wildcard rules, the database-level expressions must be identical.
If both the source and destination tables are wildcard rules, the table-level expressions must be identical.
If the destination database is a wildcard rule, the source database must also be a wildcard rule.
If the destination table is a wildcard rule, the source table must also be a wildcard rule.
Limitations
Data validation allows you to specify multiple rules. However, each rule must be on a single line without any spaces before or after.
The validation object rule cannot be empty, but the exclusion object rule can be empty.
When you select a validation object by matching a rule, the table name cannot contain special characters (including newline characters, spaces, and .|"'`()=;/&*?[][!]).
Data validation does not support mapping tables from different databases in the source database to different databases in the destination database based on multiple matching rules. For example,
a.a* = b.a* & a.b* = c.b*.
Considerations
After you configure the validation object rule and the exclusion object rule, if the table name is in the difference between the two rules, the table can be selected.
Note
The difference between two sets refers to a new set that contains all elements present in the first set but not in the second set.
If a renaming mapping exists for the table, the renaming mapping takes precedence. For example, if both
a.b[0-3]anda.b[3-5]=a.cexist, the tablea.b3is renamed toa.c.
Configure matching rules
Create a data validation task and go to the Select Type & Objects step.
For more information, see Create a data validation task.
On the Select Type & Objects step, select the validation type and validation objects.
You can select validation objects by using the Specify Objects or Match by Rule option. This topic describes how to configure matching rules.
In the Validation Objects section, enable Match by Rule.

In the Select Objects section, enter the Validation Object Rules and Object Exclusion Rules (optional). For more information about supported wildcards, see Wildcard rules.
Click Validate.
After the validation is successful, click Preview to view the results. The wildcard validation object rule and exclusion object rule that you entered apply only to tables. Matching Results includes the final objects, added objects, and removed objects.
Object Description Final Object The validation object finally matched by the configured matching rule. Added Object The validation object added compared with the previous matching result. Removed Object The validation object removed compared with the previous matching result.
Complete the remaining steps as prompted.