GetDataQualityScan

Updated at:

Retrieves the details of a data quality scan.

Operation description

You must purchase DataWorks Basic Edition or higher 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:GetDataQualityScan

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. You can obtain the ID from the PageInfo.DataQualityScans[].Id parameter returned by the ListDataQualityScans operation.

10001

Response elements

Element

Type

Description

Example

object

The response result.

RequestId

string

The request ID.

204EAF68-CCE3-5112-8DA0-E7A60F02XXXX

DataQualityScan

object

The details of the data quality scan.

Id

integer

The ID of the data quality scan.

10001

Name

string

The name of the data quality scan.

data_quality_scan_001

Description

string

The description of the data quality scan.

aily data quality scanning of ods tables.

ProjectId

integer

The ID of the DataWorks workspace to which the data quality scan belongs. You can obtain the workspace ID by calling the ListProjects operation.

101

CreateTime

integer

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

1731550150000

ModifyTime

integer

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

1731550150000

CreateUser

string

The ID of the user who created the data quality scan.

2374924198591250

ModifyUser

string

The ID of the user who last modified the data quality scan.

23482597582479

Owner

string

The ID of the owner of the data quality scan.

231263586109857423

Spec

string

The spec code of the data quality scan. For more information, see Data quality spec 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 execution parameters defined for the data quality scan.

object

The parameter information.

Value

string

The value of the parameter.

10

Name

string

The name of the parameter.

e2e_autolabel

ComputeResource

object

The compute engine used when the data quality scan runs. This parameter can be left empty. If it is not specified, the data source connection specified in the spec is used.

Name

string

The name of the compute engine, which serves as a unique identifier.

polardb_to_holo

Runtime

object

The additional settings for the data quality scan at runtime.

Engine

string

The type of the engine used. Only the E-MapReduce (EMR) compute engine supports this setting. Valid values:

  • Hive: Hive SQL

  • Spark: Spark SQL

  • Kyuubi

Hive

HiveConf

object

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

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

SparkConf

object

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

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

EnvType

string

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

  • Prod: production environment

  • Dev: development environment

Prod

RuntimeResource

object

The resource group used when the data quality scan runs.

Id

string

The ID of the resource group.

122878

Cu

number

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

10

Image

string

The ID of the image used for the runtime configuration.

hp-tlp-e2e-repo-registry-vpc.cn-heyuan-acdr-1.cr.aliyuncs.com/hp-service/worker:9b28b6d-202506091008

Trigger

object

The trigger configuration of the data quality scan.

Type

string

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

  • ByManual: manually triggered, which is the default value.

  • BySchedule: triggered by a scheduled node instance.

BySchedule

TaskIds

array

The IDs of the scheduled nodes that trigger the data quality scan when the trigger method is set to BySchedule.

integer

The ID of the scheduled node.

1023777390

Hooks

array<object>

The hook configuration after the data quality scan finishes running.

object

The hook configuration after the data quality scan finishes running.

Condition

string

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

  • Specify multiple groups of rule severity levels 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 enumerations of severity in the conditional expression are consistent with those in the spec, and the enumerations of status are consistent with those in DataQualityResult.

results.any { r -> r.status == 'Fail' && r.rule.severity == 'Normal' || r.status == 'Error' && r.rule.severity == 'High' || r.status == 'Warn' && r.rule.severity == 'High' }

Type

string

The type of the hook. Valid values:

  • BlockTaskInstance: blocks the scheduling of the node instance.

BlockTaskInstance

Examples

Success response

JSON format

{
  "RequestId": "204EAF68-CCE3-5112-8DA0-E7A60F02XXXX",
  "DataQualityScan": {
    "Id": 10001,
    "Name": "data_quality_scan_001",
    "Description": "aily data quality scanning of ods tables.",
    "ProjectId": 101,
    "CreateTime": 1731550150000,
    "ModifyTime": 1731550150000,
    "CreateUser": "2374924198591250",
    "ModifyUser": "23482597582479",
    "Owner": "231263586109857423",
    "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": "10",
        "Name": "e2e_autolabel"
      }
    ],
    "ComputeResource": {
      "Name": "polardb_to_holo",
      "Runtime": {
        "Engine": "Hive",
        "HiveConf": {
          "mapreduce.job.queuename": "dq_queue"
        },
        "SparkConf": {
          "spark.yarn.queue": "dq_queue"
        }
      },
      "EnvType": "Prod"
    },
    "RuntimeResource": {
      "Id": "122878",
      "Cu": 10,
      "Image": "hp-tlp-e2e-repo-registry-vpc.cn-heyuan-acdr-1.cr.aliyuncs.com/hp-service/worker:9b28b6d-202506091008"
    },
    "Trigger": {
      "Type": "BySchedule",
      "TaskIds": [
        1023777390
      ]
    },
    "Hooks": [
      {
        "Condition": "results.any { r -> r.status == 'Fail' && r.rule.severity == 'Normal' || r.status == 'Error' && r.rule.severity == 'High' || r.status == 'Warn' && r.rule.severity == 'High' }",
        "Type": "BlockTaskInstance"
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.