ListDataQualityResults

Updated at:

Lists data quality check results with pagination.

Note

This API has been deprecated. We recommend migrating to dataworks-public(2024-05-18) - ListDataQualityScanRuns 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 higher to use this API.

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:*

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ProjectId

integer

No

The DataWorks workspace ID.

100

DataQualityRuleId

integer

No

The data quality rule ID.

100001

DataQualityEvaluationTaskId

integer

No

The data quality evaluation task ID.

200001

DataQualityEvaluationTaskInstanceId

integer

No

The data quality evaluation task instance ID.

10001

CreateTimeFrom

integer

No

The earliest time when the data quality check results were generated.

1710239005403

CreateTimeTo

integer

No

The latest time when the data quality check results were generated.

1710239005403

BizdateFrom

string

No

The start business date of the rule instance.

2024-05-01

BizdateTo

string

No

The end business date of the rule instance.

2024-05-04

PageSize

integer

No

The number of results per page. Default value: 10.

10

PageNumber

integer

No

The page number. Default value: 1.

1

Response elements

Element

Type

Description

Example

object

The response data.

RequestId

string

The API request ID.

691CA452-D37A-****

PagingInfo

object

The paginated data quality check results.

PageNumber

integer

The page number.

1

PageSize

integer

The number of entries per page.

10

TotalCount

integer

The total number of entries.

219

DataQualityResults

array<object>

The list of data quality check results.

array<object>

The quality check result.

Id

integer

The check result ID.

16033

Status

string

The status of the check result. Valid values:

  • Running

  • Error

  • Passed

  • Warned

  • Critical

Passed

CreateTime

integer

The time when the check result was generated.

1708284916414

TaskInstanceId

integer

The ID of the data quality evaluation task instance.

200001

Sample

string

The sample value used for this check.

[ { "gender": "male", "_count": 100 }, { "gender": "female", "_count": 100 } ]

Details

array<object>

The details of this check.

object

The check detail.

ReferencedValue

string

The referenced sample value used as the baseline for calculating the checked value.

0.0

CheckedValue

string

The final value used for comparison with the threshold.

100.0

Status

string

The final comparison result status. Valid values:

  • Error

  • Passed

  • Warned

  • Critical

Passed

Rule

object

The snapshot of the rule configuration at the start of the check.

Id

integer

The rule ID.

100001

Name

string

The rule name. 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.

The table cannot be empty.

ProjectId

integer

The DataWorks workspace ID.

100

Enabled

boolean

Specifies whether the rule is enabled.

true

Severity

string

The severity level of the rule for the business, which corresponds to strong and weak rules on the page. Valid values:

  • High

  • Normal

Normal

Description

string

The description of the rule. It can be up to 500 characters in length.

this is a odps _sql task

TemplateCode

string

The code of the rule template referenced when the rule was created.

SYSTEM:user_defined_sql

Target

object

The object monitored by the rule.

Type

string

The type of the monitored object. Valid values:

  • Table

Table

DatabaseType

string

The database type of the table dataset. Valid values:

  • maxcompute

  • emr

  • cdh

  • hologres

  • analyticdb_for_postgresql

  • analyticdb_for_mysql

  • starrocks

maxcompute

TableGuid

string

The unique ID of the table in DataWorks Data Map.

odps.unit_test.tb_unit_test

SamplingConfig

object

The settings required for sample collection.

Metric

string

The name of the sampling metric. Valid values:

  • Count: The number of rows in the table.

  • Min: The minimum value of the field.

  • Max: The maximum value of the field.

  • Avg: The average value of the field.

  • DistinctCount: The number of unique values in the field.

  • DistinctPercent: The ratio of unique values to the total number of rows in the field.

  • DuplicatedCount: The number of duplicate values in the field.

  • DuplicatedPercent: The ratio of duplicate values to the total number of rows in the field.

  • TableSize: The table size.

  • NullValueCount: The number of rows with null values in the field.

  • NullValuePercent: The ratio of null values in the field.

  • GroupCount: The number of rows corresponding to each value after aggregation by field value.

  • CountNotIn: The number of rows that do not match the enumerated values.

  • CountDistinctNotIn: The number of unique values that do not match the enumerated values.

  • UserDefinedSql: Sample collection through custom SQL.

Count

MetricParameters

string

The parameters required for sample collection.

{ "columns": [ "id", "name" ] }

SettingConfig

string

The runtime parameter setting statements inserted before the sampling statement is executed. It can be up to 1,000 characters in length. Only MaxCompute is supported.

SET odps.sql.udf.timeout=600s;

SamplingFilter

string

The conditions used to filter out unneeded data during sampling. It can be up to 16,777,215 characters in length.

id IS NULL

CheckingConfig

object

The sample check settings.

Type

string

The threshold calculation method. Valid values:

  • Fixed

  • Fluctation

  • FluctationDiscreate

  • Auto

  • Average

  • Variance

Fixed

ReferencedSamplesFilter

string

The expression used to query reference samples for certain types of thresholds. The values of the reference samples are aggregated to obtain the threshold for comparison.

{ "bizdate": [ "-1", "-7", "-1m" ] }

Thresholds

object

The threshold settings.

Expected

object

The expected threshold settings.

Value

string

The threshold value.

100.0

Operator

string

The comparison operator. Valid values:

  • >

  • >=

  • <

  • <=

  • !=

  • =

>

Expression

string

The threshold expression.

For fluctuation rules, you must use an expression to represent the fluctuation threshold. Examples:

  • Fluctuation increase greater than 0.01: $checkValue > 0.01

  • Fluctuation decrease greater than 0.01: $checkValue < -0.01

  • Absolute value of fluctuation rate: abs($checkValue) > 0.01

For fixed value rules, you can also use an expression to configure the threshold. If both are configured, the expression takes precedence over Operator and Value.

$checkValue > 0.01

Warned

object

The threshold settings for common warnings.

Value

string

The threshold value.

100.0

Operator

string

The comparison operator. Valid values:

  • >

  • >=

  • <

  • <=

  • !=

  • =

>

Expression

string

The threshold expression.

For fluctuation rules, you must use an expression to represent the fluctuation threshold. Examples:

  • Fluctuation increase greater than 0.01: $checkValue > 0.01

  • Fluctuation decrease greater than 0.01: $checkValue < -0.01

  • Absolute value of fluctuation rate: abs($checkValue) > 0.01

For fixed value rules, you can also use an expression to configure the threshold. If both are configured, the expression takes precedence over Operator and Value.

$checkValue > 0.01

Critical

object

The threshold settings for critical warnings.

Value

string

The threshold value.

100.0

Operator

string

The comparison operator. Valid values:

  • >

  • >=

  • <

  • <=

  • !=

  • =

>

Expression

string

The threshold expression.

For fluctuation rules, you must use an expression to represent the fluctuation threshold. Examples:

  • Fluctuation increase greater than 0.01: $checkValue > 0.01

  • Fluctuation decrease greater than 0.01: $checkValue < -0.01

  • Absolute value of fluctuation rate: abs($checkValue) > 0.01

For fixed value rules, you can also use an expression to configure the threshold. If both are configured, the expression takes precedence over Operator and Value.

$checkValue > 0.01

ErrorHandlers

array<object>

The error handlers for data quality rule checks.

object

The error handlers for data quality rule checks.

Type

string

The handler type. Valid values:

  • SaveErrorData

SaveErrorData

ErrorDataFilter

string

The SQL statement specified by the user to filter error data for custom SQL rules.

SELECT * FROM tb_api_log WHERE id IS NULL

Examples

Success response

JSON format

{
  "RequestId": "691CA452-D37A-****",
  "PagingInfo": {
    "PageNumber": 1,
    "PageSize": 10,
    "TotalCount": 219,
    "DataQualityResults": [
      {
        "Id": 16033,
        "Status": "Passed",
        "CreateTime": 1708284916414,
        "TaskInstanceId": 200001,
        "Sample": "[\n  {\n    \"gender\": \"male\",\n    \"_count\": 100\n  }, {\n    \"gender\": \"female\",\n    \"_count\": 100\n  }\n]",
        "Details": [
          {
            "ReferencedValue": "0.0",
            "CheckedValue": "100.0",
            "Status": "Passed"
          }
        ],
        "Rule": {
          "Id": 100001,
          "Name": "The table cannot be empty.",
          "ProjectId": 100,
          "Enabled": true,
          "Severity": "Normal",
          "Description": "this is a odps _sql task",
          "TemplateCode": "SYSTEM:user_defined_sql",
          "Target": {
            "Type": "Table",
            "DatabaseType": "maxcompute",
            "TableGuid": "odps.unit_test.tb_unit_test"
          },
          "SamplingConfig": {
            "Metric": "Count",
            "MetricParameters": "{ \"columns\": [ \"id\", \"name\" ] }",
            "SettingConfig": "SET odps.sql.udf.timeout=600s; ",
            "SamplingFilter": "id IS NULL"
          },
          "CheckingConfig": {
            "Type": "Fixed",
            "ReferencedSamplesFilter": "{ \"bizdate\": [ \"-1\", \"-7\", \"-1m\" ] }",
            "Thresholds": {
              "Expected": {
                "Value": "100.0",
                "Operator": ">",
                "Expression": "$checkValue > 0.01"
              },
              "Warned": {
                "Value": "100.0",
                "Operator": ">",
                "Expression": " $checkValue > 0.01"
              },
              "Critical": {
                "Value": "100.0",
                "Operator": ">",
                "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.