All Products
Search
Document Center

DataWorks:CreateDataQualityScan

Last Updated:Jan 12, 2026

Creates a data quality monitor.

Operation description

This API operation is available for all DataWorks editions.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
DescriptionstringNo

The description of the data quality monitor.

Daily data quality scanning of ods tables.
ProjectIdlongNo

The DataWorks workspace ID. You can log on to the DataWorks console and go to the workspace configuration page to obtain the workspace ID. This parameter is required to specify the target DataWorks workspace for this API operation.

101
OwnerstringNo

The ID of the user who owns of the data quality monitor.

95279527****
SpecstringNo

Spec code for the content of the data quality monitoring.

{ "datasets": [ { "type": "Table", "dataSource": { "name": "odps_first", "envType": "Prod" }, "tables": [ "ods_d_user_info" ], "filter": "pt = $[yyyymmdd-1]" } ], "rules": [ { "assertion": "row_count > 0" }, { "templateId": "SYSTEM:field:null_value:fixed", "pass": "when = 0", "name": "The id cannot be empty.", "severity": "High", "identity": "a-customized-data-quality-rule-uuid" } ] }
Parametersarray<object>No

The definition of execution parameters for the data quality monitoring.

objectNo

The definition of execution parameters for the data quality monitoring.

ValuestringNo

The parameter values.

$[yyyymmdd-1]
NamestringNo

The parameter name.

triggerTime
RuntimeResourceobjectNo

The resource group used during execution of the data quality monitoring.

IdstringNo

The resource group ID.

0525242e-d0ee-4bda-bc73-765d82f6a34a
CufloatNo

The default number of CUs configured for task running.

0.25
ImagestringNo

The ID of the image configured for task running.

i-xxxxxx
ComputeResourceobjectNo

The compute engine used at runtime. If not specified, the data source defined in the Spec is used.

NamestringNo

The name of the compute engine, which is a unique identifier.

emr_first
RuntimeobjectNo

More settings for data quality monitoring at runtime.

EnginestringNo

The type of the compute engine. Only EMR compute engines support these settings.

Valid values:

  • Hive: Hive SQL
  • Spark: Spark SQL
  • Kyuubi
Hive
SparkConfobjectNo

Additional Spark engine parameters. Currently, only the spark.yarn.queue parameter is supported.

spark.yarn.queue=dq_queue
HiveConfobjectNo

Additional Hive engine parameters. Currently, only the mapreduce.job.queuename parameter is supported.

mapreduce.job.queuename=dq_queue
EnvTypestringNo

The workspace environment to which the compute engine belongs.

Valid values:

  • Prod: production environment .
  • Dev: development environment.
Dev
TriggerobjectNo

The trigger configurations of the data quality monitoring task.

TypestringNo

The trigger mode of the monitoring task.

Valid values:

  • ByManual: Manual trigger. This is the default setting.
  • BySchedule: Triggered by a scheduled task instance.
BySchedule
TaskIdsarrayNo

If the trigger mode is set to BySchedule, the scheduling task ID must be specified.

longNo

The ID of the scheduling task.

1004979033
Hooksarray<object>No

The Hook configurations after the data quality monitoring run ends.

objectNo

The Hook configurations after the data quality monitoring run ends.

ConditionstringNo

The Hook trigger condition. The hook will run if the condition is met. Currently, only one type of expression syntax is supported:

You can specify multiple combinations of rule severity levels and validation statuses using an expression such as results.any { r -> r.status == 'Fail' && r.rule.severity == 'Normal' || r.status == 'Error' && r.rule.severity == 'High' || r.status == 'Warn' && r.rule.severity == 'High' }. This expression means the condition is met if any executed rule has a result of Fail with severity Normal, Error with severity High, or Warn with severity High. In the condition expression, the values of severity and status are predefined enums. The values of severity must match those defined in the Spec, and the values of status must match those in DataQualityResult.

results.any { r -> r.status == 'Fail' && r.rule.severity == 'Normal' || r.status == 'Error' && r.rule.severity == 'High' || r.status == 'Warn' && r.rule.severity == 'High' }
TypestringNo

The type of the Hook.

Valid values:

  • BlockTaskInstance: Blocks the scheduling of the task instance.
BlockTaskInstance
NamestringNo

The data quality monitoring name.

data_quality_scan_001
ClientTokenstringYes

The idempotency token.

a-customized-uuid

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

Id of the request

0000-ABCD-EFG****
Idlong

Returns the ID of the created data source sharing rule, which uniquely identifies the rule.

676303114031776

Examples

Sample success responses

JSONformat

{
  "RequestId": "0000-ABCD-EFG****",
  "Id": 676303114031776
}

Error codes

For a list of error codes, visit the Service error codes.