All Products
Search
Document Center

DataWorks:ListDataQualityResults

Last Updated:Dec 23, 2024

Operation description

This API operation is available for all DataWorks editions.

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
ProjectIdlongYes

The DataWorks workspace ID.

100
BizdateFromstringNo

The beginning of the time range to query.

2024-05-01
BizdateTostringNo

The end of the time range to query.

2024-05-04
PageSizeintegerNo

The number of entries per page. Default value: 10.

10
PageNumberintegerNo

The page number. Default value: 1.

1

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

691CA452-D37A-4ED0-9441
PagingInfoobject

The pagination information.

DataQualityResultsarray<object>

The data quality check results.

DataQualityResultobject

The data quality check result.

Statusstring

The status of the check result. Valid values:

  • Running
  • Error
  • Passed
  • Warned
  • Critical
PASSED
Detailsarray<object>

The check details.

Detailobject

The check details.

Statusstring

The comparison result between the value of CheckedValue and the threshold. Valid values:

  • Error
  • Passed
  • Warned
  • Critical
PASSED
Ruleobject

The snapshot of the rule configuration when the check starts.

Severitystring

The strength of the rule. Valid values:

  • High
  • Normal
NORMAL
TemplateCodestring

The code of the template that is referenced when you create a rule.

system::user_defined
Targetobject

The monitored object of the rule.

Typestring

The type of the monitored object. Valid values:

  • Table
TABLE
DatabaseTypestring

The type of the database to which the table belongs. Valid values:

  • maxcompute
  • emr
  • cdh
  • hologres
  • analyticdb_for_postgresql
  • analyticdb_for_mysql
  • starrocks
MAX_COMPUTE
SamplingConfigobject

The sampling settings.

Metricstring

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.
COUNT
CheckingConfigobject

The check settings for sample data.

Typestring

The threshold calculation method. Valid values:

  • Fixed
  • Fluctation
  • FluctationDiscreate
  • Auto
  • Average
  • Variance
FIXED
Thresholdsobject
Expectedobject
Operatorstring
  • >
  • >=
  • <
  • <=
  • !=
  • =
>
Warnedobject
Operatorstring
  • >
  • >=
  • <
  • <=
  • !=
  • =
>
Criticalobject
Operatorstring
  • >
  • >=
  • <
  • <=
  • !=
  • =
>
ErrorHandlersarray<object>

The operations that you can perform after the rule-based check fails.

ErrorHandlerobject

The operation that you can perform after the rule-based check fails.

Typestring

The type of the operation. Valid values:

  • SaveErrorData
SAVE_ERROR_DATA

Examples

Sample success responses

JSONformat

{
  "RequestId": "691CA452-D37A-4ED0-9441",
  "PagingInfo": {
    "PageNumber": 1,
    "PageSize": 10,
    "TotalCount": 219,
    "DataQualityResults": [
      {
        "Id": 16033,
        "Status": "PASSED",
        "CreateTime": 1708284916414,
        "TaskInstanceId": 200001,
        "Sample": "[\n  {\n    \"gender\": \"male\",\n    \"_count\": 100\n  }, {\n    \"gender\": \"female\",\n    \"_count\": 100\n  }\n]",
        "Details": [
          {
            "ReferencedValue": "0.0",
            "CheckedValue": "100.0",
            "Status": "PASSED"
          }
        ],
        "Rule": {
          "Id": 100001,
          "Name": "",
          "ProjectId": 100,
          "Enabled": true,
          "Severity": "NORMAL",
          "Description": "this is a odps _sql task",
          "TemplateCode": "system::user_defined",
          "Target": {
            "Type": "TABLE",
            "DatabaseType": "MAX_COMPUTE",
            "TableGuid": "odps.unit_test.tb_unit_test",
            "PartitionSpec": "ds=$[yyyymmdd-1]"
          },
          "SamplingConfig": {
            "Metric": "COUNT",
            "MetricParameters": "{ \"columns\": [ \"id\", \"name\" ] }",
            "SettingConfig": "SET odps.sql.udf.timeout=600s; ",
            "SamplingFilter": "id IS NULL"
          },
          "CheckingConfig": {
            "Type": "FIXED",
            "ReferencedSamplesFilter": "{ \"bizdate\": [ \"-1\", \"-7\", \"-1m\" ] }",
            "Thresholds": {
              "Expected": {
                "Value": "100.0",
                "Operator": ">"
              },
              "Warned": {
                "Value": "100.0",
                "Operator": ">"
              },
              "Critical": {
                "Value": "100.0",
                "Operator": ">"
              }
            }
          },
          "ErrorHandlers": [
            {
              "Type": "SAVE_ERROR_DATA",
              "ErrorDataFilter": "SELECT * FROM tb_api_log WHERE id IS NULL"
            }
          ]
        }
      }
    ]
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-12-19The response structure of the API has changedView Change Details
2024-11-06The response structure of the API has changedView Change Details