Working with the Template Library page
Rule templates simplify rule authoring by providing a centralized library of reusable logic. You can create reusable rules to minimize the manual effort of applying similar data validation logic across multiple data sets.
Prerequisites
You have one of the following global permissions based on the actions you want to perform:
| Action | Permission requirement |
|---|---|
| View a rule template |
Data Quality > Deploy Templates > Viewer |
| Create and edit a rule template | Data Quality > Manage Templates > Creator |
Adding a rule template
-
On the main toolbar, click
→ Data Quality.
The Monitoring Overview page opens to the available data sources in your environment, showing their high-level metadata. - In the sidebar navigation on the left, click Template library.
The template library opens. - If necessary, filter the rule templates in the table using the filter options.
Tolerance Description Dimensions The type of issue to filter by, including Accuracy, Completeness, Consistency, Integrity, Validity, and Duplication.
Name The name of the rule template. Description The description of the rule template. Created by The creator of the rule template. For out-of-the-box rule templates, this value is "Collibra". Search
Search for a specific rule template. Show/hide filters
Show or hide the filter options. Clear all Clear the filter selections to show all results. - Click
Template.
- Enter the Name of the rule template.
- Select the Primary dialect for the rule template you are creating. Default value is "Spark".
- From the SQL editor in the SQL tab, enter your SQL query. Tip
- By default, you cannot edit the
SELECT * FROM {{dq-job-name}} WHEREclause. - The column variable must be represented as
{{column}}. - When you deploy the template, the column variable parameter is automatically updated based on the primary column.
- Templates currently support only one column variable parameter per template.
- By default, you cannot edit the
- Optionally, click
Format to automatically format the SQL for improved readability.
- Click Validate SQL to validate the syntax of your query.
- Optionally, select any additional supported dialects.
- Click
next to each dialect to view or modify the SQL.
- To add an unsupported dialect, click Add dialect manually and enter the dialog and SQL in the modal. Click Save.
- Select all the appropriate dialects and click Approve selected.
- Click
- On the Settings tab, enter the rule template details.
Setting Description Data quality dimension Associate a rule with an out-of-the-box (OOTB) or custom dimension. Tolerance Define the minimum percentage of rule breaks that must be found to affect rule scores and statuses, and for any notifications tied to the rule to send. When a rule filter is applied, the percentage of rule breaks is calculated based on the filtered rows.
Enter a value between 0 and 100.
Note The value 0 is equivalent to not setting a rule tolerance threshold. This means that any percentage of rule violations will be considered a breach.
Description The description of the rule template. Related assets The business asset(s) related to the rule template. You can select one or multiple assets. - Click
Save.
The rule template is created.
Editing a rule template
- Select an existing rule template in the template library.
The rule template SQL and Settings display in read-only mode. The Used In tab shows the rules that use the template. - If necessary, select the Used In tab and click
→ Detach from template to remove the connection between the template and the rule. - Click
Edit.
The rule template details display in edit mode. - Edit the details as necessary.
- Click
Save.
The changes to the rule template are saved. The changes automatically apply to rules created from the template. - If necessary, in the template library, click
→ Delete to delete a rule template. You can't delete an OOTB rule template.
-
Add or edit a custom SQL rule using a template
-
Go to the Job Details page to view the template rule usage on the Monitors tab