Skip to content

Unique Check API

The Unique check is created and managed through the standard Quality Checks API by setting rule to unique and listing one or more fields under fields. When fields contains a single entry, the check evaluates row-level uniqueness; when it contains two or more entries, it evaluates the combination of those fields as a composite key.

Tip

For complete API documentation, including request and response schemas, visit the API docs.

Endpoints

Method Path Purpose
POST /api/quality-checks Create a new Unique check.
GET /api/quality-checks/{id} Retrieve a Unique check by ID.
PUT /api/quality-checks/{id} Update an existing Unique check.
DELETE /api/quality-checks/{id} Delete (or archive) a Unique check.

Permission: Author (or above) on the target container's team for POST, PUT, and DELETE; Reporter (or above) for GET.

Payload Example

Create a composite-key Unique check on C_NAME and C_ADDRESS with POST /api/quality-checks, showing every field accepted by the create endpoint:

{
    "description": "Ensure that each combination of C_NAME and C_ADDRESS in the CUSTOMER table is unique",
    "rule": "unique",
    "fields": ["C_NAME", "C_ADDRESS"],
    "container_id": 145,
    "coverage": 1,
    "filter": null,
    "properties": null,
    "tags": ["primary-key", "pii"],
    "additional_metadata": {"jira": "DATA-1234"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 12
}

Field Notes

Field Required Notes
description Yes Free-text description shown in the UI.
rule Yes Must be "unique".
fields Yes Array of field names. One entry → single-field unique; two or more entries → composite-key unique.
container_id Yes ID of the container (table or file) the check runs against.
coverage No Fractional value between 0 and 1 (1 enforces 100% uniqueness). Defaults to 1 when omitted (strict mode: no duplicates tolerated).
filter No Spark SQL WHERE expression. Applied before the uniqueness evaluation, so only filtered rows are grouped and compared. Send null for no filter.
properties No For scalar fields, null. For Array fields, set {"is_element_context": true} to check uniqueness of elements within each array instead of treating the array as a single value.
tags No List of tag names applied to the check for filtering and organization.
additional_metadata No Free-form key-value pairs (typically links to catalog, tickets, governance records).
anomaly_message_field No Name of a source-record field whose value should be used as the anomaly message instead of the system-generated one. In the UI this corresponds to the Custom Anomaly Description toggle (ON when the field is set, OFF when null). Not applicable to Unique: because the Unique check emits only Shape Anomalies (which use a fixed message template), this field is silently ignored at evaluation time. Send null.
template_id No ID of a Check Template to associate the check with. null if not using a template.
status No "Active" (default) or "Draft". Draft checks are not evaluated by Scans.
owner_id No ID of the user who owns the check. Defaults to the user creating the check when omitted.
default_anomaly_assignee_id No ID of the user automatically assigned to anomalies produced by the check.
  • Introduction: formal definition, modes overview, field scope, and general/anomaly properties.
  • How It Works: full semantics, NULL handling, filter behavior, and edge cases.
  • Examples: three production scenarios with sample data and resulting anomalies.
  • FAQ: short answers to the most frequent questions.