Creates a data quality monitoring rule.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | Yes | The name of the rule. | |
ProjectId | long | Yes | The DataWorks workspace ID. | 10726 |
Enabled | boolean | No | Specifies whether to enable the rule. | true |
Severity | string | No | The strength of the rule. Valid values:
| Normal |
Description | string | No | The description of the rule. The description can be up to 500 characters in length. | this is a odps _sql task |
Target | object | No | The monitored object of the rule. | |
Type | string | No | The type of the monitored object. Valid values:
| Table |
DatabaseType | string | No | The type of the database to which the table belongs. Valid values:
| maxcompute |
TableGuid | string | Yes | The ID of the table that is limited by the rule in Data Map. | odps.unit_test.tb_unit_test |
PartitionSpec | string | No | The configuration of the partitioned table. | ds=$[yyyymmdd-1] |
TemplateCode | string | No | The ID of the template used by the rule. | system::user_defined |
SamplingConfig | object | No | The sampling settings. | |
Metric | string | No | The metrics used for sampling. Valid values:
| Count |
MetricParameters | string | No | The parameters required for sampling. | { "Columns": [ "id", "name" ] , "SQL": "select count(1) from table;"} |
SettingConfig | string | No | The statements that are used to configure the parameters required for sampling before you execute the sampling statements. The statements can be up to 1,000 characters in length. Only the MaxCompute database is supported. | SET odps.sql.udf.timeout=600s; SET odps.sql.python.version=cp27; |
SamplingFilter | string | No | The statements that are used to filter unnecessary data during sampling. The statements can be up to 16,777,215 characters in length. | id IS NULL |
CheckingConfig | object | No | The check settings for sample data. | |
Type | string | No | The method that is used to calculate a threshold. You can leave this parameter empty if you use a rule template. Valid values:
| Fixed |
ReferencedSamplesFilter | string | No | The method that is used to query the referenced samples. To obtain some types of thresholds, you need to query reference values. In this example, an expression is used to specify the query method of referenced samples. | { "bizdate": [ "-1", "-7", "-1m" ] } |
Thresholds | object | No | The threshold settings. | |
Expected | object | No | The expected threshold setting. | |
Operator | string | No | The comparison operator. Valid values:
| > |
Value | string | No | The threshold value. | 100.0 |
Warned | object | No | The threshold settings for normal alerts. | |
Operator | string | No | The comparison operator. Valid values:
| > |
Value | string | No | The threshold value. | 100.0 |
Critical | object | No | The threshold settings for critical alerts. | |
Operator | string | No | The comparison operator. Valid values:
| > |
Value | string | No | The threshold value. | 100.0 |
ErrorHandlers | array<object> | No | The operations that you can perform after the rule-based check fails. | |
object | No | The operation that you can perform after the rule-based check fails. | ||
Type | string | No | The type of the operation. Valid values:
| SaveErrorData |
ErrorDataFilter | string | No | The SQL statement that is used to filter failed tasks. If the rule is defined by custom SQL statements, you must specify an SQL statement to filter failed tasks. | SELECT * FROM tb_api_log WHERE id IS NULL |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "691CA452-D37A-4ED0-9441\n",
"Id": 0
}
Error codes
For a list of error codes, visit the Service error codes.