UpdateQualityRule

Updated at:

Updates the information of a 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. 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 triggered and a red alert is generated, the scheduling node 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 rule.

Verify the number of table rows

Checker

integer

No

The ID of the checker. Valid values:

  • 2: fluctuation of the 7-day average

  • 3: fluctuation of the 30-day average

  • 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-day, 7-day, 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 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 include 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 include >, >=, =, ≠, <, and <=.

Note

If Checker is set to 9, this parameter is required.

>

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 node.

dt=$[yyyymmdd]

CriticalThreshold

string

No

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

10

WarningThreshold

string

No

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

5

TemplateId

integer

No

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

7

RuleName

string

No

The name of the quality 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. Valid values:

  • true: The quality rule check is triggered when the scheduling node associated with the data quality rule generates table data.

  • false: The quality rule check is not triggered when the scheduling node associated with the data quality rule generates table data.

true

ProjectId

integer

No

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 data structure.

HttpStatusCode

integer

The HTTP status code.

200

Data

boolean

Indicates whether the quality rule was updated.

true

ErrorMessage

string

The error message.

You have no permission.

RequestId

string

The request ID. You can use this ID to troubleshoot issues when errors occur.

576b9457-2cf5-4****

ErrorCode

string

The error code.

0

Success

boolean

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