ListQualityResultsByRule

Updated at:

Checks the quality of a data source based on a check rule and queries the check results.

Note

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

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

RuleId

integer

Yes

The ID of the check rule. You can use this rule ID in combination with information such as partition expressions to perform queries.

152322134

StartDate

string

Yes

The start time of the business date, in the yyyy-MM-dd HH:mm:ss format.

This parameter is used in combination with EndDate. The time span between the two parameters cannot exceed 7 days.

2020-09-20 00:00:00

EndDate

string

Yes

The end time of the business date, in the yyyy-MM-dd HH:mm:ss format.

This parameter is used in combination with StartDate. The time span between the two parameters cannot exceed 7 days.

2020-09-22 00:00:00

PageSize

integer

Yes

The number of entries to return per page. Default value: 10. Maximum value: 20.

10

PageNumber

integer

Yes

The page number.

1

ProjectName

string

Yes

The name of the engine or data source for which you want to check data quality.

autotest

ProjectId

integer

Yes

The ID of the DataWorks workspace.

123456

Response elements

Element

Type

Description

Example

object

The check results.

HttpStatusCode

integer

The HTTP status code.

200

ErrorMessage

string

The error message.

You have no permission.

RequestId

string

The request ID.

CBA58543-00D4-41****

ErrorCode

string

The error code.

401

Success

boolean

Indicates whether the request is successful.

true

Data

object

The top-level struct for the check results.

PageNumber

integer

The page number.

1

PageSize

integer

The number of entries to return per page. Default value: 10. Maximum value: 100.

10

TotalCount

integer

The total number of data records.

200

RuleChecks

array<object>

The list of check results.

array<object>

The check result.

BlockType

integer

The strength of the check rule, which indicates the importance of the rule. Valid values:

  • 1: strong rule.

  • 0: weak rule. You can set important rules as strong rules based on your business requirements. If a strong rule is used and a red alert is triggered, the node is blocked.

1

WarningThreshold

number

The orange threshold. This threshold indicates the degree of deviation from the expected sample value. You can customize this threshold based on your business requirements.

0.1

Property

string

The field for the rule property, which is the name of the column in the checked data source table.

type

TableName

string

The name of the table that is checked.

dual

Comment

string

The description of the check rule.

The description of the rule.

CheckResultStatus

integer

The status of the check result.

2

TemplateName

string

The name of the check template that is used.

Expected value verification

CheckerName

string

The name of the checker.

fulx

RuleId

integer

The rule ID.

123421

FixedCheck

boolean

Specifies whether the check is a fixed value check. Valid values:

  • true: The check is a fixed value check.

  • false: The check is not a fixed value check.

false

Op

string

The comparison operator.

>

UpperValue

number

The predicted upper limit. This value is automatically generated after the threshold is set.

22200

ActualExpression

string

The actual partition of the checked data source table.

ds=20200925

ExternalId

string

The ID of the scheduling node.

123112232

TimeCost

string

The time taken to execute the check task, in seconds.

10

Trend

string

The trend of the check result.

up

ExternalType

string

The type of the scheduling system. Only CWF is supported.

CWF2

BizDate

integer

The business date. If the checked business entity is offline data, the business date is typically the day before the check operation is performed.

The value is a 13-digit number, such as 1600704000000.

1600704000000

CheckResult

integer

The check result.

2

ResultString

string

The check result in string format.

ResultString

MatchExpression

string

The partition expression.

ds=$[yyyymmdd]

CheckerType

integer

The type of the checker.

0

ProjectName

string

The name of the engine or data source for which you want to check data quality.

autotest

BeginTime

integer

The start time of the check operation.

The value is a 13-digit number, such as 1600704000000.

1600704000000

DateType

string

The type of the scheduling cycle. Typically, the value is YMD, which indicates yearly, monthly, or daily nodes.

YMD

CriticalThreshold

number

The red threshold. This threshold indicates the degree of deviation from the expected sample value. You can customize this threshold based on your business requirements. If a strong rule is used and the red threshold is triggered, the scheduling node is blocked.

0.6

IsPrediction

boolean

Specifies whether the result is a predicted result. Valid values:

  • true: The result is a predicted result.

  • false: The result is not a predicted result.

false

RuleName

string

The name of the rule.

The name of the rule.

CheckerId

integer

The ID of the checker.

7

DiscreteCheck

boolean

Specifies whether the check is a discrete check. Valid values:

  • true: The check is a discrete check.

  • false: The check is not a discrete check.

true

EndTime

integer

The end time for querying the check results.

The value is a 13-digit number, such as 1600704000000.

1600704000000

MethodName

string

The method used to collect sample data, such as avg, count, sum, min, max, count_distinct, user_defined, table_count, table_size, table_dt_load_count, table_dt_refuseload_count, null_value, null_value/table_count, (table_count-count_distinct)/table_count, and table_count-count_distinct.

max

LowerValue

number

The predicted lower limit. This value is automatically generated based on the threshold that you set.

2344

EntityId

integer

The ID of the partition expression.

14534343

WhereCondition

string

The filter condition used by the check task.

type!='type2'

ExpectValue

number

The expected value.

90

TemplateId

integer

The ID of the check template that is used.

5

TaskId

string

The ID of the check task.

16008552981681a0d6****

Id

integer

The primary key ID.

2231123

ReferenceValue

array<object>

The historical sample value.

object

The check result.

DiscreteProperty

string

The value of the sample field after grouping by using the GROUP BY clause. For example, if you group by the gender field, the DiscreteProperty values are male, female, and null.

type1

Value

number

The sample value.

20

BizDate

string

The business date. If the checked business entity is offline data, the business date is typically the day before the check operation is performed.

The value is a 13-digit number, such as 1600704000000.

1600704000000

SingleCheckResult

integer

The string representation of the check result.

2

Threshold

number

The threshold.

0.2

SampleValue

array<object>

The sample that is currently used.

object

The check result.

DiscreteProperty

string

The value of the sample field after grouping by using the GROUP BY clause. For example, if you group by the gender field, the DiscreteProperty values are male, female, and null.

type2

BizDate

string

The business date. If the checked business entity is offline data, the business date is typically the day before the check operation is performed.

The value is a 13-digit number, such as 1600704000000.

1600704000000

Value

number

The sample value.

23

Open

boolean

Specifies whether the rule is enabled.

true

Examples

Success response

JSON format

{
  "HttpStatusCode": 200,
  "ErrorMessage": "You have no permission.",
  "RequestId": "CBA58543-00D4-41****",
  "ErrorCode": "401",
  "Success": true,
  "Data": {
    "PageNumber": 1,
    "PageSize": 10,
    "TotalCount": 200,
    "RuleChecks": [
      {
        "BlockType": 1,
        "WarningThreshold": 0.1,
        "Property": "type",
        "TableName": "dual",
        "Comment": "The description of the rule.",
        "CheckResultStatus": 2,
        "TemplateName": "Expected value verification",
        "CheckerName": "fulx",
        "RuleId": 123421,
        "FixedCheck": false,
        "Op": ">",
        "UpperValue": 22200,
        "ActualExpression": "ds=20200925",
        "ExternalId": "123112232",
        "TimeCost": "10",
        "Trend": "up",
        "ExternalType": "CWF2",
        "BizDate": 1600704000000,
        "CheckResult": 2,
        "ResultString": "ResultString",
        "MatchExpression": "ds=$[yyyymmdd]",
        "CheckerType": 0,
        "ProjectName": "autotest",
        "BeginTime": 1600704000000,
        "DateType": "YMD",
        "CriticalThreshold": 0.6,
        "IsPrediction": false,
        "RuleName": "The name of the rule.",
        "CheckerId": 7,
        "DiscreteCheck": true,
        "EndTime": 1600704000000,
        "MethodName": "max",
        "LowerValue": 2344,
        "EntityId": 14534343,
        "WhereCondition": "type!='type2'",
        "ExpectValue": 90,
        "TemplateId": 5,
        "TaskId": "16008552981681a0d6****",
        "Id": 2231123,
        "ReferenceValue": [
          {
            "DiscreteProperty": "type1",
            "Value": 20,
            "BizDate": "1600704000000",
            "SingleCheckResult": 2,
            "Threshold": 0.2
          }
        ],
        "SampleValue": [
          {
            "DiscreteProperty": "type2",
            "BizDate": "1600704000000",
            "Value": 23
          }
        ],
        "Open": true
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.