UpdateDataQualityRuleTemplate

Updated at:

Updates a data quality rule template.

Note

This API has been deprecated. We recommend migrating to dataworks-public(2024-05-18) - UpdateDataQualityTemplate for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.

Operation description

You can call this operation only after you purchase DataWorks Basic Edition or a higher edition.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

Code

string

Yes

The code of the rule template.

USER_DEFINED:123

Name

string

No

The name of the rule template. The name can contain digits, letters, Chinese characters, and half-width and full-width punctuation marks. The name can be up to 512 characters in length.

Table row Count Verification

ProjectId

integer

Yes

The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the ID.

This parameter specifies the DataWorks workspace used for this API call.

10000

DirectoryPath

string

No

The category directory in which the custom template is stored. Levels are separated by forward slashes (/). The name of each level can be up to 1024 characters in length and cannot contain whitespace characters or forward slashes (/).

/ods/order_data

SamplingConfig

object

No

The settings required for sample collection.

Metric

string

No

The name of the metric to be sampled. Valid values:

  • Count: the number of table rows.

  • Min: the minimum value of a field.

  • Max: the maximum value of a field.

  • Avg: the average value of a field.

  • DistinctCount: the number of distinct values of a field.

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

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

  • DuplicatedPercent: the ratio of the number of duplicate values of a 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 percentage of rows in which the field is null.

  • GroupCount: the number of data rows corresponding to each value after the field values are aggregated.

  • CountNotIn: the number of rows whose values 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.

Max

MetricParameters

string

No

The parameters required for sample collection.

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

SettingConfig

string

No

The runtime parameter setting statements that are inserted and executed before the sampling statements are executed. The statements can be up to 1,000 characters in length. Only MaxCompute is supported.

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

CheckingConfig

object

No

The settings for sample validation.

Type

string

No

The type of the monitored object. Valid values:

  • Table

Table

ReferencedSamplesFilter

string

No

For some types of thresholds, you must query reference samples and then aggregate the values of the reference samples to obtain the threshold used for comparison. An expression is used here to indicate the query method of reference samples.

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

Response elements

Element

Type

Description

Example

object

The returned data.

RequestId

string

Id of the request

691CA452-D37A-4ED0-****

Success

boolean

Indicates whether the update was successful.

true

Examples

Success response

JSON format

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

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.