すべてのプロダクト
Search
ドキュメントセンター

DataWorks:CreateDataQualityRule

最終更新日:Sep 03, 2026

Data Quality ルールを作成します。

説明

この API は廃止されました。一時的にアクセス可能ですが、更新やバグ修正対応は一切行われません。代わりに dataworks-public(2024-05-18) - CreateDataQualityScan への移行を推奨します。より強化された機能に加え、サポートも引き続きご利用いただけます。

操作説明

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

今すぐお試しください

この API を OpenAPI Explorer でお試しください。手作業による署名は必要ありません。呼び出しに成功すると、入力したパラメーターに基づき、資格情報が組み込まれた SDK コードが自動的に生成されます。このコードをダウンロードしてローカルで使用できます。

テスト

RAM 認証

この操作の認証情報はありません。問題が発生した場合は、アカウントマネージャーにご連絡ください。

リクエストパラメーター

パラメーター

型

必須 / 任意

説明

例

Name

string

必須

ルールの名前。

The table cannot be empty.

ProjectId

integer

必須

DataWorks ワークスペースの ID。

10726

Enabled

boolean

任意

Data Quality ルールを有効にするかどうかを指定します。

true

Severity

string

任意

ビジネスに対するルールの重大度(ページ上の強/弱ルールに対応)。有効な値:

  • 法線

  • High

Normal

Description

string

任意

ルールの説明。最大値は 500 文字です。

this is a odps _sql task

Target

object

必須

ルールによって監視されるオブジェクト。

Type

string

任意

The type of the monitored object.

  • Table

Table

DatabaseType

string

必須

For a table-type dataset, the type of database to which the table belongs.

  • maxcompute

  • emr

  • cdh

  • hologres

  • analyticdb_for_postgresql

  • analyticdb_for_mysql

  • starrocks

maxcompute

TableGuid

string

必須

The unique ID of the table in Data Map on which the rule operates.

odps.unit_test.tb_unit_test

PartitionSpec

string

任意

The partition settings of the partitioned table.

ds=$[yyyymmdd-1]

TemplateCode

string

必須

ルールがリファレンスするルールテンプレートの一意の識別子。

SYSTEM:table:table_count:fixed

SamplingConfig

object

任意

サンプルコレクションに必須の設定項目。

Metric

string

任意

The name of the metric to be sampled. You do not need to specify this parameter when a template is used.

  • 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 distinct values of the field.

  • DistinctPercent: the ratio of the number of distinct values of the field to the number of data rows.

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

  • DuplicatedPercent: the ratio of the number of duplicate values of the field to the number of data rows.

  • TableSize: the size of the table.

  • NullValueCount: the number of rows in which the field is null.

  • NullValuePercent: the ratio of rows in which the field is null.

  • GroupCount: the values aggregated by field value and the corresponding number of data rows for each value.

  • CountNotIn: the number of rows whose enum values do not match.

  • CountDistinctNotIn: the number of distinct values that do not match the enum values.

  • UserDefinedSql: collects samples by using a custom SQL statement.

Count

MetricParameters

string

任意

The parameters required during sample collection.

{ "Columns": [ "id", "name" ] , "SQL": "select count(1) from table;"}

SettingConfig

string

任意

The runtime parameter setting statements to be inserted and executed before the sampling statement is executed. The maximum length is 1000 characters. Only MaxCompute is supported.

SET odps.sql.udf.timeout=600s; SET odps.sql.python.version=cp27;

SamplingFilter

string

任意

The condition used to perform a secondary filter on the irrelevant data during sampling. The maximum length is 16777215 characters.

id IS NULL

CheckingConfig

object

任意

サンプルチェックの設定項目。

Type

string

任意

The threshold calculation method. You do not need to specify this parameter when a template is used.

  • Fixed

  • Fluctation

  • FluctationDiscreate

  • Auto

  • Average

  • Variance

Fixed

ReferencedSamplesFilter

string

任意

Some types of thresholds require querying for reference samples and then summarizing the values of the reference samples to derive the threshold to be compared. An expression is used here to represent the query method for the reference samples.

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

Thresholds

object

任意

The threshold settings.

Expected

object

任意

The expected threshold settings.

Operator

string

任意

The comparison operator. Valid values:

  • >

  • >=

  • <

  • <=

  • !=

  • =

>

Value

string

任意

The threshold value.

100.0

Expression

string

任意

The threshold expression.

If the template specified by the TemplateCode parameter is about fluctuation, you must use an expression to represent the threshold for fluctuation. Example:

  • $checkValue > 0.01

  • $checkValue < -0.01

  • abs($checkValue) > 0.01

If the template specified by the TemplateCode parameter is about fixed value, you can also use an expression to represent the threshold. If you configure the Expression, Operator, and Value parameters for the threshold at the same time, the Expression parameter takes precedence over the Operator and Value parameters.

$checkValue <= 0.01

Warned

object

任意

The threshold settings for a normal warning.

Operator

string

任意

The comparison operator. Valid values:

  • >

  • >=

  • <

  • <=

  • !=

  • =

>

Value

string

任意

The threshold value.

100.0

Expression

string

任意

The threshold expression.

If the template specified by the TemplateCode parameter is about fluctuation, you must use an expression to represent the threshold for fluctuation. Example:

  • $checkValue > 0.01

  • $checkValue < -0.01

  • abs($checkValue) > 0.01

If the template specified by the TemplateCode parameter is about fixed value, you can also use an expression to represent the threshold. If you configure the Expression, Operator, and Value parameters for the threshold at the same time, the Expression parameter takes precedence over the Operator and Value parameters.

$checkValue > 0.01

Critical

object

任意

The threshold settings for a critical warning.

Operator

string

任意

The comparison operator. Valid values:

  • >

  • >=

  • <

  • <=

  • !=

  • =

>

Value

string

任意

The threshold value.

100.0

Expression

string

任意

The threshold expression.

If the template specified by the TemplateCode parameter is about fluctuation, you must use an expression to represent the threshold for fluctuation. Example:

  • $checkValue > 0.01

  • $checkValue < -0.01

  • abs($checkValue) > 0.01

If the template specified by the TemplateCode parameter is about fixed value, you can also use an expression to represent the threshold. If you configure the Expression, Operator, and Value parameters for the threshold at the same time, the Expression parameter takes precedence over the Operator and Value parameters.

$checkValue > 0.05

ErrorHandlers

array<object>

任意

Data Quality ルールチェックの発行ハンドラのリスト。

object

任意

The issue handler for the data quality rule check.

Type

string

任意

The handler type:

  • SaveErrorData

SaveErrorData

ErrorDataFilter

string

任意

For a custom SQL rule, you must specify an SQL statement to filter problematic data.

SELECT * FROM tb_api_log WHERE id IS NULL

レスポンスフィールド

フィールド

型

説明

例

object

The returned data.

RequestId

string

The ID of the API request.

691CA452-D37A-4ED0-9441

Id

integer

The ID of the rule.

19715

例

成功レスポンス

JSONJSON

{
  "RequestId": "691CA452-D37A-4ED0-9441\n",
  "Id": 19715
}

エラーコード

完全なリストについては、「エラーコード」をご参照ください。

変更履歴

完全なリストについては、「変更履歴」をご参照ください。