Queries quality monitoring rules by paging.
This API has been deprecated. We recommend migrating to dataworks-public(2024-05-18) - ListDataQualityScans 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 higher edition to use this feature.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:* |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
The DataWorks workspace ID. |
10002 |
| DataQualityEvaluationTaskId |
integer |
No |
The ID of the associated quality check task. |
10000 |
| TableGuid |
string |
No |
The unique identifier of the table that the rule applies to in DataWorks Data Map. |
odps.unit_test.tb_unit_test |
| Name |
string |
No |
The rule name for fuzzy matching. |
unit_test |
| PageSize |
integer |
No |
The number of entries per page. Default value: 10. Maximum value: 200. |
10 |
| PageNumber |
integer |
Yes |
The page number for paging. Default value: 1. |
1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
691CA452-D37A-4ED0-9441 |
| PagingInfo |
object |
The paginated query result of the rule list. |
|
| PageNumber |
integer |
The page number. |
1 |
| PageSize |
integer |
The page size. |
10 |
| TotalCount |
integer |
The total number of entries. |
294 |
| DataQualityRules |
array<object> |
The list of rules. |
|
|
array<object> |
|||
| Id |
integer |
Rule ID. |
22130 |
| Name |
string |
Rule name. |
The table cannot be empty. |
| ProjectId |
integer |
DataWorks workspace ID. |
100001 |
| Enabled |
boolean |
Whether the data quality rule is enabled. |
true |
| Severity |
string |
Severity level of the rule for the business (corresponding to strong/weak rules on the page). Valid enumerated values:
|
High |
| Description |
string |
Rule description. Maximum length: 500 characters. |
this is a odps _sql task |
| Target |
object |
Object monitored by the rule. |
|
| Type |
string |
Type of the monitored object.
|
Table |
| DatabaseType |
string |
For table-type datasets, the database type to which the table belongs.
|
maxcompute |
| TableGuid |
string |
Unique ID of the table to which the rule applies in Data Map. |
odps.unit_test.tb_unit_test |
| TemplateCode |
string |
Unique identifier of the rule template referenced by the rule. |
SYSTEM:user_defined_sql |
| SamplingConfig |
object |
Settings required for sample collection. |
|
| Metric |
string |
Sampling metric name.
|
Max |
| MetricParameters |
string |
Parameters required during sample collection. |
{ "Columns": [ "id", "name" ] , "SQL": "select count(1) from table;"} |
| SettingConfig |
string |
Runtime parameter setting statements inserted and executed before the sampling statement is actually executed. Maximum length: 1,000 characters. Currently only MaxCompute is supported. |
SET odps.sql.udf.timeout=600s; SET odps.sql.python.version=cp27; |
| SamplingFilter |
string |
Condition for the secondary filtering of data that is not of concern during sampling. Maximum length: 16,777,215 characters. |
id IS NULL |
| CheckingConfig |
object |
Sample validation settings. |
|
| Type |
string |
Threshold calculation method.
|
Fixed |
| ReferencedSamplesFilter |
string |
Some types of thresholds require querying some reference samples, then aggregating the values of the reference samples to obtain the threshold for comparison. An expression is used here to represent the query method for the reference samples. |
{ "bizdate": [ "-1", "-7", "-1m" ] } |
| Thresholds |
object |
Threshold settings. |
|
| Expected |
object |
Expected threshold settings. |
|
| Operator |
string |
Comparison operator.
|
> |
| Value |
string |
Threshold value. |
100.0 |
| Expression |
string |
Threshold expression. Fluctuation rate type rules must use the expression method to indicate the fluctuation threshold. Examples:
Fixed value type rules can also configure thresholds using expressions. If both are configured, the expression takes precedence over Operator and Value. |
$checkValue > 0.01 |
| Warned |
object |
Threshold settings for normal warnings. |
|
| Operator |
string |
Comparison operator.
|
> |
| Value |
string |
Threshold value. |
100.0 |
| Expression |
string |
Threshold expression. Fluctuation rate type rules must use the expression method to indicate the fluctuation threshold. Examples:
Fixed value type rules can also configure thresholds using expressions. If both are configured, the expression takes precedence over Operator and Value. |
$checkValue > 0.01 |
| Critical |
object |
Threshold settings for critical warnings. |
|
| Operator |
string |
Comparison operator.
|
> |
| Value |
string |
Threshold value. |
100.0 |
| Expression |
string |
Threshold expression. Fluctuation rate type rules must use the expression method to indicate the fluctuation threshold. Examples:
Fixed value type rules can also configure thresholds using expressions. If both are configured, the expression takes precedence over Operator and Value. |
$checkValue > 0.01 |
| ErrorHandlers |
array<object> |
List of issue handlers for data quality rule validation. |
|
|
object |
Issue handler for data quality rule validation. |
||
| Type |
string |
Handler type:
|
SaveErrorData |
| ErrorDataFilter |
string |
For custom SQL rules, the user needs to specify SQL to filter problem data. |
SELECT * FROM tb_api_log WHERE id IS NULL |
Examples
Success response
JSON format
{
"RequestId": "691CA452-D37A-4ED0-9441",
"PagingInfo": {
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 294,
"DataQualityRules": [
{
"Id": 22130,
"Name": "The table cannot be empty.",
"ProjectId": 100001,
"Enabled": true,
"Severity": "High",
"Description": "this is a odps _sql task",
"Target": {
"Type": "Table",
"DatabaseType": "maxcompute",
"TableGuid": "odps.unit_test.tb_unit_test"
},
"TemplateCode": "SYSTEM:user_defined_sql",
"SamplingConfig": {
"Metric": "Max",
"MetricParameters": "{ \"Columns\": [ \"id\", \"name\" ] , \"SQL\": \"select count(1) from table;\"}",
"SettingConfig": "SET odps.sql.udf.timeout=600s; \nSET odps.sql.python.version=cp27;",
"SamplingFilter": "id IS NULL"
},
"CheckingConfig": {
"Type": "Fixed",
"ReferencedSamplesFilter": "{ \"bizdate\": [ \"-1\", \"-7\", \"-1m\" ] }",
"Thresholds": {
"Expected": {
"Operator": ">",
"Value": "100.0",
"Expression": "$checkValue > 0.01"
},
"Warned": {
"Operator": ">",
"Value": "100.0",
"Expression": "$checkValue > 0.01"
},
"Critical": {
"Operator": ">",
"Value": "100.0",
"Expression": "$checkValue > 0.01"
}
}
},
"ErrorHandlers": [
{
"Type": "SaveErrorData\n",
"ErrorDataFilter": "SELECT * FROM tb_api_log WHERE id IS NULL"
}
]
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.