All Products
Search
Document Center

DataWorks:UpdateQualityRule

Last Updated:Mar 23, 2026

Updates a specified quality rule.

Note

This API has been deprecated. We recommend migrating to dataworks-public(2024-05-18) - UpdateDataQualityScan for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

BlockType

integer

No

The strength of the quality rule. You can specify a rule as a strong or weak rule based on the importance of the rule. Valid values:

  • 1: strong rule

  • 0: weak rule If you specify a rule as a strong rule and a critical alert is triggered for the rule, the scheduling of the associated task is blocked.

0

EntityId

integer

No

The ID of the partition filter expression. You can call the ListQualityRules operation to query the ID of the partition filter expression.

123

Comment

string

No

The description of the quality rule.

Verify the number of table rows

Checker

integer

No

The checker ID. You can call the ListQualityRules operation to query the checker ID.

9

ExpectValue

string

No

The expected value.

300

Id

integer

Yes

The rule ID. You can call the ListQualityRules operation to query the rule ID.

1234

Trend

string

No

The trend of the check result. Valid values:

  • up: upward trend

  • down: downward trend

  • abs: absolute value

up

MethodName

string

Yes

The name of the method used to collect sample data. Valid values: avg, count, sum, min, max, count_distinct, user_defined, table_count, table_size, table_dt_load_count, table_dt_refuseload_count, null_value, null_value/table_count, (table_count-count_distinct)/table_count, and table_count-count_distinct.

table_count

Operator

string

No

The comparison operator. Valid values: >, >=, =, !=, <, and <=.

Note

This parameter is required if you set the Checker parameter to 9.

>

ProjectName

string

Yes

The name of the engine or data source. You can log on to the DataWorks console and go to the Workspace Management page to obtain the name.

autotest

Property

string

Yes

The name of the field.

id

PropertyType

string

No

The data type of the field.

bigint

RuleType

integer

No

The type of the rule. Valid values:

  • 0: system template

  • 1: custom SQL

  • 2: custom template

0

WhereCondition

string

No

The filter condition or custom SQL statement that is used for the check.

dt=$[yyyymmdd]

CriticalThreshold

string

No

The threshold for a critical alert. The threshold specifies the deviation of a check result from the expected value. You can customize the threshold based on your business requirements. If you use a strong rule and a critical alert is triggered, the scheduling of the associated task is blocked.

10

WarningThreshold

string

No

The threshold for a warning alert. The threshold specifies the deviation of a check result from the expected value. You can customize the threshold based on your business requirements.

5

TemplateId

integer

No

The ID of the template that is used for the check. You can call the ListQualityRules operation to query the template ID.

7

RuleName

string

No

The name of the quality rule.

123

PredictType

integer

No

Specifies whether to use a dynamic threshold. Valid values:

  • 0: no

  • 2: yes

0

OpenSwitch

boolean

No

Specifies whether to enable or disable the quality rule. This parameter specifies whether to run the quality rule in the production environment.

  • true: The quality rule is triggered when the scheduling task that is associated with the output table of the rule runs.

  • false: The quality rule is not triggered when the scheduling task that is associated with the output table of the rule runs.

true

ProjectId

integer

Yes

The DataWorks workspace ID.

26

TaskSetting

string

No

The variable settings that are inserted before a custom rule. The settings are in the format of x=a,y=b.

x=a,y=b

Response elements

Element

Type

Description

Example

object

The response data.

HttpStatusCode

integer

The HTTP status code.

200

Data

boolean

Indicates whether the validation rule was successfully updated.

true

ErrorMessage

string

The error message returned when the request fails.

You have no permission.

RequestId

string

The ID of the request, used for troubleshooting.

576b9457-2cf5-4****

ErrorCode

string

The error code returned when the request fails.

0

Success

boolean

Indicates whether the API call was successful.

true

Examples

Success response

JSON format

{
  "HttpStatusCode": 200,
  "Data": true,
  "ErrorMessage": "You have no permission.",
  "RequestId": "576b9457-2cf5-4****",
  "ErrorCode": "0",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.