Create a custom SQL rule using SQL AI

You can use SQL AI to suggest custom SQL queries based on your plain-text input.

Prerequisites

Steps

  1. Select the job to which you want to add a rule from the Job drop-down list, or enter its name in the input field.
  2. Enter a unique name in the Rule name input field.
  3. Note You cannot use a name that is already in use by another rule in the job. Rule names can contain periods (.), underscores (_), and hyphens (-). All other special characters are not allowed.

  4. Optionally, select a primary column from the Primary column drop-down list. This allows Collibra to associate your rule with a column asset based on the selected primary column.
  5. Important When the Require primary column setting is enabled, this field is required.
  6. In the upper-right corner of the SQL editor, click AI icon SQL AI to allow Collibra to suggest a SQL query based on your plain-text input.
    The SQL AI chat box appears in the right side of the SQL editor.
  7. In the chat box input field, enter a plain-text prompt.
  8. Example 
    • "high is more than 50"
    • "find all of the unique values in Column1 and show how many records exist for each"
    • "compare the 2 dates 2018-01-13 to 2018-01-14 - write 2 separate queries for each date, using trade date - write as a common table expression for tables a and b - join using symbol column - use a join to identify which values are in 2018-01-14 that are not in 2018-01-13 - the goal is to find values that are missing from the previous day"
  9. Click Send icon.
    A suggested SQL query is returned.
  10. Click Content copy icon to copy the suggested SQL to your clipboard. You can also click Assignment return outlined icon to paste it directly into the SQL editor.
  11. Optionally, click Align left icon Format to automatically format the SQL for improved readability.
  12. Optionally, click Validate SQL to validate the syntax of your query.
  13. Optionally, click the Settings tab.
    The settings tab opens, where you can associate data quality dimensions with your rule, set a rule tolerance percentage, and add notifications and a description.
  14. Click Save.
    The rule is added to your job.

What's next