Creating Rule Templates

Creating rules is the core functional module of Data Quality Control (DQC). Offline data monitoring is supported. Therefore, you can create rules based on the actual requirements. You can create a rule template or customize a rule based on the requirements.

There are 20 built-in rule templates, including database-level rule templates, table-level rule templates, field-level rule templates, and cross-field rule templates. If these built-in rule templates cannot meet your requirements, you can customize a rule template. See the description below for details.

  1. Choose Quality Monitoring > Rule Template and click Create. On the Create Rule Template page, configure the required parameters.

    Figure 1 Creating rule templates

  2. In the displayed dialog box, enter the rule name, select the rule matching dimension, define the SQL template, describe the output result, and click OK.

    • Dimension: You can complete single-column, cross-column, cross-row, and cross-table analysis from six dimensions: integrity, validity, timeliness, consistency, accuracy, and uniqueness. When customizing a quality rule, select a dimension for rule matching.
    • Define Relationship: Enter SQL statements to search for data.
      • Example: To count the number of rows in a table, enter select count(${Column1}) from ${Schema_Table1}. The value of ${Column1} is generated by clicking Add Field Parameter, and the value of ${Schema_Table1} is generated by clicking Add Database Table Parameter.
    • Output Description: describes each column in the SQL result. Column descriptions are separated with commas (,).
      • Example: If the relationship is set to select max (${Column1}), min(${Column2}) from ${Schema_Table1}, the output result is "Maximum value, Minimum value". The result description must correspond to the output result sequence defined by the relationship.
        Figure 2 Configuring a rule template

Managing a Rule Template

You can modify and view the publication history of a custom rule template. To modify a custom rule template, do as follows:

  1. On the DQC homepage, select Rule Template from the left navigation bar. Locate the target rule template in the displayed list and click Edit in the Operation column.

    Figure 3 Editing a rule template

  2. Dimensions can be modified, output description can be modified, and relationships can be redefined.
  3. Click Save to save the settings.
  4. Click Publish. In the displayed dialog box, set the version. Save the new rule template and upgrade it.

    Figure 4 Publishing the new rule template

  5. Click OK. Go back to the rule template list and click View Publish History in the Operation column. View the publication history and compare the versions to display the modifications.

    Figure 5 Version comparison