All Products
Search
Document Center

DataWorks:UpdateDataQualityRule

Last Updated:Sep 03, 2026

Memperbarui aturan kualitas data.

Catatan

API ini telah ditinggalkan. Kami merekomendasikan migrasi ke dataworks-public(2024-05-18) - UpdateDataQualityScan guna memperoleh fungsionalitas yang lebih baik dan dukungan berkelanjutan. Meskipun API yang telah ditinggalkan ini masih dapat diakses sementara, tidak akan ada pembaruan atau perbaikan bug lebih lanjut.

Deskripsi operasi

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

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tidak ada otorisasi untuk operasi ini. Jika Anda mengalami masalah saat menjalankan operasi ini, hubungi dukungan teknis.

Parameter permintaan

Parameter

Type

Required

Description

Example

Id

integer

Yes

ID aturan.

100001

Name

string

No

Nama aturan. Nama dapat berupa kombinasi angka, huruf Inggris, karakter Tionghoa, dan tanda baca setengah lebar atau lebar penuh. Panjang maksimum adalah 255 karakter.

表不能为空

Enabled

boolean

No

Apakah aturan akan diaktifkan.

true

Severity

string

No

Tingkat keparahan aturan untuk bisnis (sesuai dengan aturan kuat/lemah pada halaman). Nilai valid:

  • Normal

  • High.

High

Description

string

No

Deskripsi aturan. Panjang maksimum adalah 500 karakter.

this is a odps _sql task

ProjectId

integer

Yes

ID ruang kerja DataWorks. Anda dapat masuk ke Konsol DataWorks dan membuka halaman Pengaturan Ruang Kerja untuk mendapatkan ID ruang kerja.

10000

TemplateCode

string

No

Pengenal unik templat aturan yang direferensikan oleh aturan.

SYSTEM:table:table_count:fixed

SamplingConfig

object

No

Pengaturan yang diperlukan untuk pengambilan sampel.

Metric

string

No

The name of the metric to sample. This parameter is not required 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 in the field.

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

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

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

  • TableSize: the size of the table.

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

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

  • GroupCount: the number of data rows for each value after aggregation by field value.

  • CountNotIn: the number of rows that do not match the enumerated values.

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

  • UserDefinedSql: sample collection by using custom SQL.

Min

MetricParameters

string

No

The parameters required for sample collection.

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

SettingConfig

string

No

The runtime parameter setting statements to be inserted and executed before the actual sampling statements. The maximum length is 1,000 characters. Only MaxCompute is supported.

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

SamplingFilter

string

No

The condition used to apply secondary filtering on data that is not of interest during sampling. The maximum length is 16,777,215 characters.

id IS NULL

CheckingConfig

object

No

Pengaturan verifikasi sampel.

Type

string

No

The threshold calculation method. This parameter is not required when a template is used.

  • Fixed

  • Fluctation

  • FluctationDiscreate

  • Auto

  • Average

  • Variance

Fixed

ReferencedSamplesFilter

string

No

Some types of thresholds require querying reference samples and then aggregating the values of those reference samples to derive the threshold used for comparison. An expression is used here to indicate how the reference samples are queried.

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

Thresholds

object

No

The threshold settings.

Expected

object

No

The expected threshold settings.

Operator

string

No

The comparison operator. Valid values:

  • >

  • >=

  • <

  • <=

  • !=

  • =

>

Value

string

No

The threshold value.

100.0

Expression

string

No

The threshold expression.

The volatility type rule must use an expression to represent the volatility threshold. For example:

  • Fluctuation rise greater than 0.01: $checkValue > 0.01

  • Fluctuation drop greater than 0.01:$checkValue < -0.01

  • Absolute volatility: abs($checkValue) > 0.01

You can also use expressions to configure thresholds for fixed-Value rules. If you configure them at the same time, the expression priority is higher than Operator and Value.

$checkValue <= 0.01

Warned

object

No

The threshold settings for normal warnings.

Operator

string

No

The comparison operator. Valid values:

  • >

  • >=

  • <

  • <=

  • !=

  • =

>

Value

string

No

The threshold value.

100.0

Expression

string

No

The threshold expression.

The volatility type rule must use an expression to represent the volatility threshold. For example:

  • Fluctuation rise greater than 0.01: $checkValue > 0.01

  • Fluctuation drop greater than 0.01:$checkValue < -0.01

  • Absolute volatility: abs($checkValue) > 0.01

You can also use expressions to configure thresholds for fixed-Value rules. If you configure them at the same time, the expression priority is higher than Operator and Value.

$checkValue > 0.01

Critical

object

No

The threshold settings for critical warnings.

Operator

string

No

The comparison operator. Valid values:

  • >

  • >=

  • <

  • <=

  • !=

  • =

>

Value

string

No

The threshold value.

100.0

Expression

string

No

The threshold expression.

The volatility type rule must use an expression to represent the volatility threshold. For example:

  • Fluctuation rise greater than 0.01: $checkValue > 0.01

  • Fluctuation drop greater than 0.01:$checkValue < -0.01

  • Absolute volatility: abs($checkValue) > 0.01

You can also use expressions to configure thresholds for fixed-Value rules. If you configure them at the same time, the expression priority is higher than Operator and Value.

$checkValue > 0.05

ErrorHandlers

array<object>

No

Daftar penanganan masalah untuk verifikasi aturan kualitas data.

object

No

An issue handler for data quality rule verification.

Type

string

No

The handler type.

  • SaveErrorData

SaveErrorData

ErrorDataFilter

string

No

For a custom SQL rule, you must specify the SQL used to filter problematic data.

SELECT * FROM tb_api_log WHERE id IS NULL

Elemen respons

Element

Type

Description

Example

object

The returned data.

RequestId

string

Id of the request

691CA452-D37A-4ED0-9441

Success

boolean

Indicates whether the update was successful.

true

Contoh

Respons sukses

JSONformat

{
  "RequestId": "691CA452-D37A-4ED0-9441\n",
  "Success": true
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.