UpdateDataQualityRule
Updates a quality rule.
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.
Operation description
You must purchase DataWorks Basic Edition or a later edition to use this operation.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Id |
integer |
Yes |
The ID of the rule. |
100001 |
| Name |
string |
No |
The name of the rule. The name can contain digits, letters, Chinese characters, and half-width or full-width punctuation marks. It can be up to 255 characters in length. |
Table cannot be empty |
| Enabled |
boolean |
No |
Specifies whether the rule is enabled. |
true |
| Severity |
string |
No |
The severity level of the rule for the business, which corresponds to the strong or weak rule on the page. Valid values:
Valid values:
|
High |
| Description |
string |
No |
The description of the rule. It can be up to 500 characters in length. |
this is a odps _sql task |
| ProjectId |
integer |
Yes |
The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Configuration page to obtain the workspace ID. |
10000 |
| TemplateCode |
string |
No |
The unique identifier of the rule template referenced by the rule. |
SYSTEM:table:table_count:fixed |
| SamplingConfig |
object |
No |
The settings required for sample collection. |
|
| Metric |
string |
No |
The name of the sampling metric. This parameter is optional when a template is used. Valid values:
|
Min |
| MetricParameters |
string |
No |
The parameters required for sample collection. |
{ "Columns": [ "id", "name" ] , "SQL": "select count(1) from table;"} |
| SettingConfig |
string |
No |
The runtime parameter setting statements that are inserted and executed before the sampling statements are executed. It can be up to 1,000 characters in length. Only MaxCompute is supported. |
SET odps.sql.udf.timeout=600s; SET odps.sql.python.version=cp27; |
| SamplingFilter |
string |
No |
The condition used to filter out unneeded data during sampling. It can be up to 16,777,215 characters in length. |
id IS NULL |
| CheckingConfig |
object |
No |
The sample check settings. |
|
| Type |
string |
No |
The threshold calculation method. This parameter is optional when a template is used. Valid values:
|
Fixed |
| ReferencedSamplesFilter |
string |
No |
For some types of thresholds, reference samples must be queried, and the values of the reference samples are aggregated to obtain the threshold for comparison. This parameter uses an expression to specify the query method for the reference samples. |
{ "bizdate": [ "-1", "-7", "-1m" ] } |
| Thresholds |
object |
No |
The threshold settings. |
|
| Expected |
object |
No |
The expected threshold settings. |
|
| Operator |
string |
No |
The comparison operator. Valid values:
|
> |
| Value |
string |
No |
The threshold value. |
100.0 |
| Expression |
string |
No |
The threshold expression. For fluctuation rules, you must use an expression to specify the fluctuation threshold. Examples:
|
$checkValue <= 0.01 |
| Warned |
object |
No |
The threshold settings for common warnings. |
|
| Operator |
string |
No |
The comparison operator. Valid values:
|
> |
| Value |
string |
No |
The threshold value. |
100.0 |
| Expression |
string |
No |
The threshold expression. For fluctuation rules, you must use an expression to specify the fluctuation threshold. Examples:
|
$checkValue > 0.01 |
| Critical |
object |
No |
The threshold settings for critical warnings. |
|
| Operator |
string |
No |
The comparison operator. Valid values:
|
> |
| Value |
string |
No |
The threshold value. |
100.0 |
| Expression |
string |
No |
The threshold expression. For fluctuation rules, you must use an expression to specify the fluctuation threshold. Examples:
|
$checkValue > 0.05 |
| ErrorHandlers |
array<object> |
No |
The list of error handlers for quality rule check issues. |
|
|
object |
No |
The error handler for quality rule check issues. |
||
| Type |
string |
No |
The type of the error handler. Valid values:
|
SaveErrorData |
| ErrorDataFilter |
string |
No |
If the rule is a custom SQL rule, you must specify an SQL statement to filter the error data. |
SELECT * FROM tb_api_log WHERE id IS NULL |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
Id of the request |
691CA452-D37A-4ED0-9441 |
| Success |
boolean |
Indicates whether the update was successful. |
true |
Examples
Success response
JSON format
{
"RequestId": "691CA452-D37A-4ED0-9441\n",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.