全部產品
Search
文件中心

DataWorks:GetDataQualityScanRun - 擷取資料品質掃描運行詳情

更新時間:Mar 21, 2026

通過指定ID查詢資料品質掃描任務的運行詳情。

介面說明

需要購買 DataWorks 基礎版及以上版本才能使用。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求文法

POST  HTTP/1.1

請求參數

名稱

類型

必填

描述

樣本值

Id

integer

資料品質監控運行記錄 ID。

1006059507

返回參數

名稱

類型

描述

樣本值

object

返回結果。

RequestId

string

請求 ID。

0bc14115****159376359

DataQualityScanRun

object

資料品質監控運行記錄。

Id

integer

運行記錄 ID。

1016440997

CreateTime

integer

資料品質監控開始已耗用時間。

1706247622000

FinishTime

integer

資料品質監控運行結束時間。

1706247622000

Status

string

當前運行狀態。

  • Pass

  • Running

  • Error

  • Warn

  • Fail

Fail

Scan

object

校正開始時,資料品質監控配置快照。

Id

integer

資料品質監控 ID。

21077

Name

string

資料品質校正任務名稱,數字、英文字母、漢字、半形全形標點符號組合,最長 255 個字元。

Hourly partition quality monitoring

Description

string

資料品質校正任務描述,最長 65535 個字元。

This is a hourly run data quality evaluation plan.

ProjectId

integer

專案 ID。

164024

CreateTime

integer

資料品質監控建立時間。

1706247622000

ModifyTime

integer

資料品質監控更新時間。

1706247622000

CreateUser

string

資料品質監控建立人。

7892346529452

ModifyUser

string

資料品質監控最新動向人。

7892346529452

Owner

string

資料品質監控責任人。

7892346529452

Spec

string

資料品質監控 Spec,詳情請參見資料品質 Spec 配置說明

{ "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>

資料品質監控的參數設定。

object

資料品質監控的參數設定。

Value

string

參數值。

$[yyyy-mm-dd-1]

Name

string

參數名。

dt

ComputeResource

object

資料品質監控計算資源設定。

Name

string

計算資源名稱,對應到計算資源 API 的 ComputeResource 資料結構中的 Name 屬性。

emr_cluster_001

Runtime

object

資料品質監控在運行時的更多設定。

Engine

string

使用的引擎類型,只有 EMR 計算引擎支援設定這部分內容。

  • Hive

  • Spark

  • Kyuubi

Hive

SparkConf

object

使用 Spark 引擎時,更多的參數設定,目前只支援通過 spark.yarn.queue 設定隊列。

spark.yarn.queue=dq_queue

HiveConf

object

使用 Hive 引擎時,更多的參數設定,目前只支援通過 mapreduce.job.queuename 設定隊列。

mapreduce.job.queuename=dq_queue

EnvType

string

計算引擎所屬的工作空間環境。

  • Prod

  • Dev

Dev

RuntimeResource

object

資料品質監控運行時,使用的資源群組。

Id

string

資源群組 ID。

60597

Cu

number

資源群組預留 CU。

1

Image

string

回合組態的鏡像 ID。

i-xxxx

Trigger

object

資料品質監控觸發配置。

Type

string

資料品質監控觸發方式。

  • ByManual

  • BySchedule

BySchedule

TaskIds

array

當觸發方式為 BySchedule 時,需要配置觸發品質監控的調度任務 ID。

integer

調度任務 ID。

1014217266

Hooks

array<object>

資料品質監控運行結束後的 Hook 配置。

object

資料品質監控運行結束後的 Hook 配置。

Condition

string

Hook 觸發條件,當滿足這個條件時,會觸發 Hook 運行。目前只支援一種運算式寫法:

  • 指定多組規則嚴重類型和規則校正狀態,如results.any { r -> r.status == 'Fail' && r.rule.severity == 'Normal' || r.status == 'Error' && r.rule.severity == 'High' || r.status == 'Warn' && r.rule.severity == 'High' },代表執行的規則中,如果有 severity 為 Normal 的規則校正結果是 Fail、或者 severity 為 High 的規則校正結果是 Error、或者 severity 為 High 的規則校正結果是 Warn,則滿足條件。條件運算式中 severity 的枚舉與 Spec 中 severity 的枚舉一致、status 的枚舉與 DataQualityResult 中的 status 一致。

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

Type

string

Hook 類型。

  • BlockTaskInstance

BlockTaskInstance

Parameters

array<object>

實際運行時,使用的參數設定。

object

參數設定。

Value

string

參數值。

$[yyyy-mm-dd-1]

Name

string

參數名。

dt

Results

array<object>

具體每條規則的校正結果。

array<object>

規則的校正結果。

Status

string

校正結果狀態。

  • Pass

  • Running

  • Error

  • Warn

  • Fail

Fail

Details

array<object>

本次校正的詳情。

object

本次校正的詳情。

Status

string

最終的比較結果狀態。

  • Pass

  • Error

  • Warn

  • Fail

Fail

ReferenceValue

string

使用引用的樣本,用來參與 CheckedValue 計算的基準值。

0.0

CheckValue

string

最終用來與閾值比較的值。

100.0

Sample

string

本次校正所使用的樣本值。

{ "value": "100.0" }

CreateTime

integer

校正結果產生時間。

1725506795000

Rule

string

校正開始時,規則 Spec 快照。

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

樣本

正常返回樣本

JSON格式

{
  "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": {
            "test": "test",
            "test2": 1
          },
          "HiveConf": {
            "test": "test",
            "test2": 1
          }
        },
        "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}"
      }
    ]
  }
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情