All Products
Search
Document Center

DataWorks:UpdateQualityRule

Last Updated:Jul 31, 2026

Calls UpdateQualityRule to update the information of a quality check 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 check rule. The strength indicates the importance of the rule. Valid values:

  • 1: strong rule.

  • 0: weak rule. You can set important rules as strong rules based on your business requirements. If a strong rule is used and a red alert is triggered, the scheduling task is blocked.

Valid values:

  • 0 :

    Weak rule.

  • 1 :

    Strong rule.

0

EntityId

integer

No

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

123

Comment

string

No

The description of the quality check rule.

Verify the number of table rows

Checker

integer

No

The checker ID. 2: 7-day average fluctuation. 3: 30-day average fluctuation. 4: 1-day cycle comparison. 5: 7-day cycle comparison. 6: 30-day cycle comparison. 7: 7-day variance fluctuation. 8: 30-day variance fluctuation. 9: comparison with a fixed value. 10: 1-, 7-, and 30-day fluctuation detection. 11: previous cycle comparison. You can call the ListQualityRules operation to obtain the checker ID.

9

ExpectValue

string

No

The expected value of the check result.

300

Id

integer

Yes

The ID of the quality check rule. You can call the ListQualityRules operation to obtain 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

When Checker is set to 9, Operator is a required parameter.

>

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 type of the field.

bigint

RuleType

integer

No

The type of the rule. Valid values:

  • 0: system template rule.

  • 1: custom SQL rule.

  • 4: custom template rule.

0

WhereCondition

string

No

The filter condition or custom SQL statement used by the check task.

dt=$[yyyymmdd]

CriticalThreshold

string

No

The red alert threshold. This value indicates the degree of deviation from the expected sample value. You can customize this threshold based on your business requirements. If a strong rule is used and the red threshold is triggered, the scheduling task is blocked.

10

WarningThreshold

string

No

The orange alert threshold. This value indicates the degree of deviation from the expected sample value. You can customize this threshold based on your business requirements.

5

TemplateId

integer

No

The ID of the check template. You can call the ListQualityRules operation to obtain the check template ID.

7

RuleName

string

No

The name of the quality check rule.

123

PredictType

integer

No

Specifies whether the threshold is dynamic. Valid values:

  • 0: non-dynamic threshold.

  • 2: dynamic threshold.

0

OpenSwitch

boolean

No

The enabled or disabled status of the rule, which controls whether the quality rule runs in the production environment.

  • true: When the scheduling task associated with the output table data of the data quality rule is executed, the quality rule check is triggered.

  • false: When the scheduling task associated with the output table data of the data quality rule is executed, the quality rule check is not triggered.

true

ProjectId

integer

Yes

The ID of the DataWorks workspace.

26

TaskSetting

string

No

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

x=a,y=b

Response elements

Element

Type

Description

Example

object

The response struct.

HttpStatusCode

integer

The HTTP status code.

200

Data

boolean

Indicates whether the quality check rule is updated.

true

ErrorMessage

string

The error message.

You have no permission.

RequestId

string

The request ID. You can use this ID to troubleshoot issues.

576b9457-2cf5-4****

ErrorCode

string

The error code.

0

Success

boolean

Indicates whether the call is 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.