All Products
Search
Document Center

DataWorks:UpdateDataQualityRuleTemplate

Last Updated:Dec 10, 2024

Updates a data quality monitoring rule template.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
CodestringYes

The code for the template.

USER_DEFINED:123
NamestringNo

The name of the template. The name can be up to 512 characters in length and can contain digits, letters, and punctuation marks.

ProjectIdlongYes

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

You must configure this parameter to specify the DataWorks workspace to which the API operation is applied.

10000
DirectoryPathstringNo

The directory in which the template is stored. Slashes (/) are used to separate directory levels. The name of each directory level can be up to 1,024 characters in length. It cannot contain whitespace characters or slashes (/).

SamplingConfigobjectNo

The sampling settings.

MetricstringNo

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
MetricParametersstringNo

The parameters required for sampling.

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

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;
CheckingConfigobjectNo

The check settings for sample data.

TypestringNo

The type of the monitored object. Valid values:

  • Table
Table
ReferencedSamplesFilterstringNo

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 specify the query method of referenced samples.

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

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

691CA452-D37A-4ED0-9441
Successboolean

Indicates whether the request was successful.

true

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history