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

DataWorks:GetDataQualityRuleTemplate

最終更新日:Sep 03, 2026

データ品質ルールテンプレートの詳細をクエリします。

説明

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

操作説明

この操作は、DataWorks Basic Edition 以上のエディションを購入している場合にのみ呼び出すことができます。

今すぐお試しください

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

テスト

RAM 認証

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

リクエストパラメーター

パラメーター

型

必須 / 任意

説明

例

Code

string

必須

ルールテンプレートのコード。

USER_DEFINED:123

レスポンスフィールド

フィールド

型

説明

例

object

返されるデータ。

RequestId

string

リクエストID。

691CA452-D37A-4E****

DataQualityRuleTemplate

object

ルールテンプレートの詳細。

Code

string

ルールテンプレートのコード。

USER_DEFINED:123

Name

string

ルールテンプレートの名前。名前は数字、文字、漢字、半角または全角の句読点を組み合わせて指定できます。名前は最大 512 文字までです。

Table row Count Verification

ProjectId

integer

DataWorksワークスペースのID。

4020

SamplingConfig

object

サンプル収集に必要な設定。

Metric

string

The metrics used for sampling. Valid values:

  • 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 unique values of the field after deduplication.

  • DistinctPercent: the proportion of the number of unique values of the field after deduplication to the number of rows in the table.

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

  • DuplicatedPercent: the proportion of the number of duplicated values of the field to the number of rows in the table.

  • TableSize: the table size.

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

  • NullValuePercent: the proportion of the number of rows in which the field value is null to the number of rows in the table.

  • GroupCount: the field value and the number of rows for each field value.

  • CountNotIn: the number of rows in which the field values are different from the referenced values that you specified in the rule.

  • CountDistinctNotIn: the number of unique values that are different from the referenced values that you specified in the rule after deduplication.

  • UserDefinedSql: indicates that data is sampled by executing custom SQL statements.

Max

MetricParameters

string

The parameters required for sampling.

{"SQL": "select count(1) from table;"}

SettingConfig

string

The statements that are used to configure the parameters required for sampling before you execute the sampling statements. The statements can be up to 1,000 characters in length. Only the MaxCompute database is supported.

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

CheckingConfig

object

サンプル検証の設定。

Type

string

The threshold calculation method. Valid values:

  • Fixed

  • Fluctation

  • FluctationDiscreate

  • Auto

  • Average

  • Variance

Fixed

ReferencedSamplesFilter

string

The method that is used to query the referenced samples. To obtain some types of thresholds, you need to query reference samples and perform aggregate operations on the reference values. In this example, an expression is used to indicate the query method of referenced samples.

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

VisibleScope

string

テンプレートが利用可能な範囲:

  • Tenant: テナント全体で利用可能。

  • Project: 現在のプロジェクト内でのみ利用可能。

Project

DirectoryPath

string

カスタムテンプレートが保存されるカテゴリディレクトリ。レベルはスラッシュ (/) で区切られます。各レベル名は最大 1,024 文字までで、空白文字またはスラッシュ (/) を含めることはできません。

/ods/order_data

例

成功レスポンス

JSONJSON

{
  "RequestId": "691CA452-D37A-4E****",
  "DataQualityRuleTemplate": {
    "Code": "USER_DEFINED:123",
    "Name": "Table row Count Verification",
    "ProjectId": 4020,
    "SamplingConfig": {
      "Metric": "Max",
      "MetricParameters": "{\"SQL\": \"select count(1) from table;\"}",
      "SettingConfig": "SET odps.sql.udf.timeout=600s; \nSET odps.sql.python.version=cp27;\n"
    },
    "CheckingConfig": {
      "Type": "Fixed",
      "ReferencedSamplesFilter": "{ \"bizdate\": [ \"-1\", \"-7\", \"-1m\" ] }\n"
    },
    "VisibleScope": "Project",
    "DirectoryPath": "/ods/order_data"
  }
}

エラーコード

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

変更履歴

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