GetDataQualityScanRun

Updated at:

Queries the details of a specified data quality scan run.

Operation description

You must purchase DataWorks Basic Edition or a higher edition to use this feature.

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:GetDataQualityScanRun

get

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

Id

integer

No

The ID of the data quality scan run. This parameter is required. You can obtain the ID from the PageInfo.DataQualityScanRuns[].Id parameter returned by the ListDataQualityScanRuns operation.

1006059507

Response elements

Element

Type

Description

Example

object

The returned results.

RequestId

string

The request ID.

0bc14115****159376359

DataQualityScanRun

object

The data quality scan run.

Id

integer

The ID of the scan run.

1016440997

CreateTime

integer

The time when the scan run was created. The value is a UNIX timestamp in milliseconds.

1706247622000

FinishTime

integer

The time when the scan run was last updated. The value is a UNIX timestamp in milliseconds.

1706247622000

Status

string

The current status of the scan run. Valid values:

  • Pass

  • Running

  • Error

  • Warn

  • Fail

Fail

Scan

object

The snapshot of the data quality scan configuration at the start of the check.

Id

integer

The ID of the data quality scan.

21077

Name

string

The name of the data quality check task. The name can contain digits, letters, Chinese characters, and half-width or full-width punctuation marks, and can be up to 255 characters in length.

Hourly partition quality monitoring

Description

string

The description of the data quality check task. The description can be up to 65,535 characters in length.

This is a hourly run data quality evaluation plan.

ProjectId

integer

The ID of the project.

164024

CreateTime

integer

The time when the data quality scan was created. The value is a UNIX timestamp in milliseconds.

1706247622000

ModifyTime

integer

The time when the data quality scan was last modified. The value is a UNIX timestamp in milliseconds.

1706247622000

CreateUser

string

The user who created the data quality scan.

7892346529452

ModifyUser

string

The user who last updated the data quality scan.

7892346529452

Owner

string

The owner of the data quality scan.

7892346529452

Spec

string

The specification of the data quality scan. For more information, see Data quality specification configuration.

{ "datasets": [ { "type": "Table", "dataSource": { "name": "odps_first", "envType": "Prod" }, "tables": [ "ods_d_user_info" ], "filter": "pt = $[yyyymmdd-1]" } ], "rules": [ { "assertion": "row_count > 0" }, { "templateId": "SYSTEM:field:null_value:fixed", "pass": "when = 0", "name": "The id cannot be empty.", "severity": "High", "identity": "a-customized-data-quality-rule-uuid" } ] }

Parameters

array<object>

The parameter settings of the data quality scan.

object

The parameter settings of the data quality scan.

Value

string

The value of the parameter.

$[yyyy-mm-dd-1]

Name

string

The name of the parameter.

dt

ComputeResource

object

The compute resource settings of the data quality scan.

Name

string

The name of the compute resource. This corresponds to the Name property in the ComputeResource data structure of the compute resource API.

emr_cluster_001

Runtime

object

The additional runtime settings of the data quality scan.

Engine

string

The type of the engine used. This parameter can be configured only when the EMR compute engine is used. Valid values:

  • Hive

  • Spark

  • Kyuubi

Hive

SparkConf

object

The additional parameter settings when the Spark engine is used. Currently, you can only set the queue by using spark.yarn.queue.

{"spark.yarn.queue": "dq_queue"}

HiveConf

object

The additional parameter settings when the Hive engine is used. Currently, you can only set the queue by using mapreduce.job.queuename.

{"mapreduce.job.queuename": "dq_queue"}

EnvType

string

The workspace environment to which the compute engine belongs. Valid values:

  • Prod

  • Dev

Dev

RuntimeResource

object

The resource group used when the data quality scan runs.

Id

string

The ID of the resource group.

60597

Cu

number

The reserved compute units (CUs) of the resource group.

1

Image

string

The ID of the image used for the runtime configuration.

i-xxxx

Trigger

object

The trigger configuration of the data quality scan.

Type

string

The trigger method of the data quality scan. Valid values:

  • ByManual

  • BySchedule

BySchedule

TaskIds

array

The IDs of the scheduled tasks that trigger the data quality scan. This parameter is required when the trigger method is BySchedule.

integer

The ID of the scheduled task.

1014217266

Hooks

array<object>

The hook configuration after the data quality scan finishes.

object

The hook configuration after the data quality scan finishes.

Condition

string

The trigger condition of the hook. When this condition is met, the hook is triggered. Currently, only one expression format is supported:

  • Specify multiple groups of rule severity types and rule check statuses. For example, results.any { r -> r.status == 'Fail' && r.rule.severity == 'Normal' || r.status == 'Error' && r.rule.severity == 'High' || r.status == 'Warn' && r.rule.severity == 'High' } indicates that when you execute the rules, if the check result of a rule with the severity of Normal is Fail, the check result of a rule with the severity of High is Error, or the check result of a rule with the severity of High is Warn, the condition is met. The enum values of severity in the conditional expression are the same as those in the specification, and the enum values of status are the same as those in DataQualityResult.

results.any { r -> r.status == 'fail' && r.rule.severity == 'High' }

Type

string

The type of the hook. Valid values:

  • BlockTaskInstance

BlockTaskInstance

Parameters

array<object>

The parameter settings used during the actual run.

object

The parameter settings.

Value

string

The value of the parameter.

$[yyyy-mm-dd-1]

Name

string

The name of the parameter.

dt

Results

array<object>

The check results of each rule.

array<object>

The check result of the rule.

Status

string

The status of the check result. Valid values:

  • Pass

  • Running

  • Error

  • Warn

  • Fail

Fail

Details

array<object>

The details of the current check.

object

The details of the current check.

Status

string

The status of the final comparison result. Valid values:

  • Pass

  • Error

  • Warn

  • Fail

Fail

ReferenceValue

string

The baseline value that is used to calculate the CheckedValue based on the referenced sample.

0.0

CheckValue

string

The final value used to compare with the threshold.

100.0

Sample

string

The sample value used for the current check.

{ "value": "100.0" }

CreateTime

integer

The time when the check result was generated. The value is a UNIX timestamp in milliseconds.

1725506795000

Rule

string

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

{ "templateId": "SYSTEM:field:null_value:fixed", "pass": "when = 0", "name": "The id cannot be empty.", "severity": "High", "identity": "a-customized-data-quality-rule-uuid" }

Examples

Success response

JSON format

{
  "RequestId": "0bc14115****159376359",
  "DataQualityScanRun": {
    "Id": 1016440997,
    "CreateTime": 1706247622000,
    "FinishTime": 1706247622000,
    "Status": "Fail",
    "Scan": {
      "Id": 21077,
      "Name": "Hourly partition quality monitoring",
      "Description": "This is a hourly run data quality evaluation plan.",
      "ProjectId": 164024,
      "CreateTime": 1706247622000,
      "ModifyTime": 1706247622000,
      "CreateUser": "7892346529452",
      "ModifyUser": "7892346529452",
      "Owner": "7892346529452",
      "Spec": "{\n    \"datasets\": [\n        {\n            \"type\": \"Table\",\n            \"dataSource\": {\n                \"name\": \"odps_first\",\n                \"envType\": \"Prod\"\n            },\n            \"tables\": [\n                \"ods_d_user_info\"\n            ],\n            \"filter\": \"pt = $[yyyymmdd-1]\"\n        }\n    ],\n    \"rules\": [\n        {\n            \"assertion\": \"row_count > 0\"\n        }, {\n            \"templateId\": \"SYSTEM:field:null_value:fixed\",\n            \"pass\": \"when = 0\",\n            \"name\": \"The id cannot be empty.\",\n            \"severity\": \"High\",\n             \"identity\": \"a-customized-data-quality-rule-uuid\"\n        }\n    ]\n}",
      "Parameters": [
        {
          "Value": "$[yyyy-mm-dd-1]",
          "Name": "dt"
        }
      ],
      "ComputeResource": {
        "Name": "emr_cluster_001",
        "Runtime": {
          "Engine": "Hive",
          "SparkConf": {
            "spark.yarn.queue": "dq_queue"
          },
          "HiveConf": {
            "mapreduce.job.queuename": "dq_queue"
          }
        },
        "EnvType": "Dev"
      },
      "RuntimeResource": {
        "Id": "60597",
        "Cu": 1,
        "Image": "i-xxxx"
      },
      "Trigger": {
        "Type": "BySchedule",
        "TaskIds": [
          1014217266
        ]
      },
      "Hooks": [
        {
          "Condition": "results.any { r -> r.status == 'fail' && r.rule.severity == 'High' }",
          "Type": "BlockTaskInstance"
        }
      ]
    },
    "Parameters": [
      {
        "Value": "$[yyyy-mm-dd-1]",
        "Name": "dt"
      }
    ],
    "Results": [
      {
        "Status": "Fail",
        "Details": [
          {
            "Status": "Fail",
            "ReferenceValue": "0.0",
            "CheckValue": "100.0"
          }
        ],
        "Sample": "{\n  \"value\": \"100.0\"\n}\n",
        "CreateTime": 1725506795000,
        "Rule": "{\n    \"templateId\": \"SYSTEM:field:null_value:fixed\",\n    \"pass\": \"when = 0\",\n    \"name\": \"The id cannot be empty.\",\n    \"severity\": \"High\",\n    \"identity\": \"a-customized-data-quality-rule-uuid\"\n}"
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.