Batch import quality rules

Updated at:

Dataphin lets you batch import quality rules from an Excel file to configure rules for multiple data tables at once.

Prerequisites

The data tables must be published to the production environment. For more information, see Manage publishing tasks.

Limits

  • You can import quality rules for Dataphin tables and global data tables using an Excel file.

  • You can only batch import custom SQL quality rules.

Permissions

  • Quality administrators can configure quality rules for all monitored objects.

  • Quality owners can configure quality rules only for the monitored objects that they own.

Batch import quality rules

  1. On the Dataphin home page, choose Administration > Data Quality from the menu bar.

  2. In the navigation pane on the left, click Quality Rule. On the Quality Rule page, in the upper-right corner, click the image icon next to the Add Quality Rule button and select Batch Import Quality Rules from the drop-down list.

  3. In the Batch Import Quality Rules dialog box, upload the file and click Start Validation.

    Parameter

    Description

    STEP 1: Download The Upload Template

    If you already have a template, upload the configuration file and start validation. Otherwise, click to download the quality rule template (.xlsx). You can also click Export Quality Rules to modify and re-upload existing rules.

    Note

    You must have the permissions to configure quality rules to upload Excel files.

    STEP 2: Upload The Excel Record File

    After you add data tables and rules to the template, upload the Excel file. Only one file can be uploaded at a time. The template format follows the custom SQL system template for a single table. For more information, see Configure quality rules.

    In addition to the preceding configuration items, configure the following parameters:

    • Rule Template Source: Required. An error is reported if left empty.

      Valid values: System and Custom. If you select System, the system parses and validates the custom SQL field values. If you select Custom, the system skips parsing because the values are already configured in the rule template.

    • Rule Template Type: Optional. Select a template type. The options are custom statistical metric check and custom data detail check.

    • Rule Configuration: Required when the rule template source is Custom and the template contains variables.

      • Assign values to all variables except t1.

      • If the monitored table is a Dataphin table, you can enter another Dataphin table as the value of the table variable in the `project.table` format. If the monitored table is a global data table, you can enter another global data table as the value of the table variable in the `schema.table` format.

      • For a field variable, use the field name directly as its value.

      • The variable t1 defaults to the current monitored table. You do not need to enter a value for this variable.

    Note
    • A single Excel file cannot contain more than 1,000 rows or exceed 10 MB in size.

    • Only .xlsx files are supported.

  4. After you upload the Excel file, select a file compatibility policy and view the validation result.

    Parameter

    Description

    Compatibility Policy

    Specifies how to handle conflicts between uploaded rules and existing online records. Valid values: Overwrite and Skip.

    • Overwrite: If the uploaded rule has the same table, field, and rule name as an existing rule, the existing rule is overwritten.

    • Skip: If the uploaded rule has the same table, field, and rule name as an existing rule, the duplicate rule is skipped during the upload.

    Validation Results

    View information about records that passed validation, failed validation, or are duplicates.

    • Validation Passed: Displays records that passed the upload validation. The information includes the row number in the original file, the monitored object, and the rule name.

    • Validation Abnormal: Displays records that caused an error during parsing or validation. The information includes the row number in the original file, the monitored object, the rule name, and an error message.

    • Duplicate Records: Displays records that are duplicates within the upload or that match existing online records. The information includes the row number in the original file, the monitored object, the rule name, and a duplication message.

    • Download Validation Results: Click the Download Validation Records button to download the validation records as an Excel file.

  5. Click Upload. On the Add Quality Rule page, you can add schedules, change the effective status, and manage owners. For more information, see Batch add quality rules.

What to do next

After importing the quality rules, you can view and manage them on the Quality Rule page. For more information, see Manage the list of monitored objects.