Data Quality ルールを作成します。
この API は廃止されました。一時的にアクセス可能ですが、更新やバグ修正対応は一切行われません。代わりに dataworks-public(2024-05-18) - CreateDataQualityScan への移行を推奨します。より強化された機能に加え、サポートも引き続きご利用いただけます。
操作説明
You must purchase DataWorks Basic Edition or higher to use this feature.
今すぐお試しください
テスト
RAM 認証
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| Name |
string |
必須 |
ルールの名前。 |
The table cannot be empty. |
| ProjectId |
integer |
必須 |
DataWorks ワークスペースの ID。 |
10726 |
| Enabled |
boolean |
任意 |
Data Quality ルールを有効にするかどうかを指定します。 |
true |
| Severity |
string |
任意 |
ビジネスに対するルールの重大度(ページ上の強/弱ルールに対応)。有効な値:
|
Normal |
| Description |
string |
任意 |
ルールの説明。最大値は 500 文字です。 |
this is a odps _sql task |
| Target |
object |
必須 |
ルールによって監視されるオブジェクト。 |
|
| Type |
string |
任意 |
The type of the monitored object.
|
Table |
| DatabaseType |
string |
必須 |
For a table-type dataset, the type of database to which the table belongs.
|
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 |
| 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 |
| 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:
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:
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:
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 |
| 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
}
エラーコード
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。