Queries the historical monitoring results based on a partition filter expression.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListQualityResultsByEntity

The operation that you want to perform.

EndDate String Yes 2020-09-21 00:00:00

The end of the time range to query. Specify the time in the yyyy-MM-dd HH:mm:ss format.

EntityId Integer Yes 152322134

The ID of the partition filter expression. You can call the GetQualityEntity operation to query the ID of a partition filter expression.

PageNumber Integer Yes 1

The number of the page to return.

PageSize Integer Yes 10

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

ProjectName String Yes autotest

The name of the engine or data source. You can obtain the name from data source configurations.

StartDate String Yes 2020-09-20 00:00:00

The beginning of the time range to query. Specify the time in the yyyy-MM-dd HH:mm:ss format.

RegionId String No cn-hangzhou

The region ID of the workspace. For example, the ID of the China (Shanghai) region is cn-shanghai, and that of the China (Zhangjiakou) region is cn-zhangjiakou. The system automatically determines the value of this parameter based on the endpoint used to call the operation.

Response parameters

Parameter Type Example Description
RequestId String CBA58543-00D4-41****

The ID of the request.

Data Struct

The top structure of the monitoring results.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

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

RuleChecks Array of RuleChecks

The monitoring results.

ActualExpression String ds=20200912

The actual number of partitions of the monitored table in the data source.

BeginTime Long 1600704000000

The time when the monitoring started.

BizDate Long 1600704000000

The date on which the business was performed. If the monitored business entity is offline data, the value is usually one day before the monitoring is performed.

BlockType Integer 0

The type of the monitoring rule. The strength of monitoring rules indicates the importance of the rules. Valid values:

  • 1: indicates that the monitoring rule is a strong rule.
  • 0: indicates that the monitoring rule is a weak rule.

    You can specify whether a monitoring rule is a strong rule based on your business requirements. If a strong rule is used and error alerts are reported, nodes are blocked.

CheckResult Integer 0

The monitoring result. Valid values:

  • 0: indicates that the data source table is normal.
  • 1: indicates that a warning alert is reported.
  • 2: indicates that an error alert is reported.
CheckResultStatus Integer 0

The status of the monitoring result. Valid values:

  • 0: indicates that the data source table is normal.
  • 1: indicates that a warning alert is reported.
  • 2: indicates that an error alert is reported.
CheckerId Integer 7

The ID of the checker.

CheckerName String fulx

The name of the checker.

CheckerType Integer 0

The monitoring type. Valid values:

  • 1: VOLATILITY_CHECK
  • 2: FIXEDVALUE_CHECK
Comment String Test rule

The description of the monitoring rule.

CriticalThreshold Float 0.5

The error threshold. The threshold indicates the deviation of monitoring results from expected values. You can customize this threshold based on your business requirements. If a strong rule is used and error alerts are reported, nodes are blocked.

DateType String YMD

The type of the scheduling cycle. In most cases, the value of this parameter is YMD. This value indicates year, month, and day.

DiscreteCheck Boolean true

Indicates whether the monitoring is discrete monitoring. Valid values:

  • true: indicates that the monitoring is discrete monitoring.
  • false: indicates that the monitoring is not discrete monitoring.
EndTime Long 1600704000000

The end time of the monitoring.

EntityId Integer 15432322

The ID of the partition filter expression.

ExpectValue Float 200

The expected value.

ExternalId String 1112323123

The ID of the node.

ExternalType String CWF2

The type of the scheduling system. Only CWF scheduling systems are supported.

FixedCheck Boolean false

Indicates whether the monitoring is performed based on a fixed value. Valid values:

  • true: indicates that the monitoring is performed based on a fixed value.
  • false: indicates that the monitoring is performed based on a non-fixed value.
Id Integer 121212121

The ID of the primary key.

IsPrediction Boolean true

Indicates whether the monitoring result is the same as the prediction result. Valid values:

  • true: indicates that the monitoring result is the same as the prediction result.
  • false: indicates that the monitoring result is different from the prediction result.
LowerValue Float 2344

The lower limit of the prediction result. The lower limit is automatically generated based on the threshold you specified.

MatchExpression String ds=$[yyyymmdd]

The partition filter expression.

MethodName String count_distinct

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.

Op String >

The comparison operator.

ProjectName String autotest

The name of the engine or data source for which data quality is monitored.

Property String type

The field of the rule attribute. This field is the column name of the data source table that is monitored.

ReferenceValue Array of ReferenceValue

The historical sample value.

BizDate String 2020-12-03

The date on which the business was performed. If the monitored business entity is offline data, the value is usually one day before the monitoring is performed.

DiscreteProperty String 0

The values of the sample field that are grouped by using the GROUP BY clause. For example, the values of the Gender field are grouped by using the GROUP BY clause. In this case, the values of DiscreteProperty are Male, Female, and null.

SingleCheckResult Integer 0

The monitoring result.

Threshold Float 0.5

The threshold.

Value Float 19

The check value.

ResultString String test

The string of the monitoring result.

RuleId Integer 123123232

The ID of the monitoring rule.

RuleName String Test

The name of the monitoring rule.

SampleValue Array of SampleValue

The sample that is used.

BizDate String 2020-12-03

The date on which the business was performed. If the monitored business entity is offline data, the value is usually one day before the monitoring is performed.

DiscreteProperty String 0

The values of the sample field that are grouped by using the GROUP BY clause. For example, the values of the Gender field are grouped by using the GROUP BY clause. In this case, the values of DiscreteProperty are Male, Female, and null.

Value Float 19

The current sample value.

TableName String dual

The name of the table that is monitored.

TaskId String 16008552981681a0d6****

The ID of the monitoring task.

TemplateId Integer 5

The ID of the monitoring template.

TemplateName String Compare the Number of Unique Field Values Against Expectation

The name of the monitoring template.

TimeCost String 202

The time that was taken to run the monitoring task. Unit: seconds.

Trend String abs

The trend of the monitoring result.

UpperValue Float 25555

The upper limit of the prediction result. The upper limit is automatically generated based on the threshold that you specified.

WarningThreshold Float 0.1

The warning threshold. The threshold indicates the deviation of monitoring results from expected values. You can customize this threshold based on your business requirements.

WhereCondition String id>0

The filter condition of the monitoring rule.

TotalCount Long 50

The total number of entries returned.

ErrorCode String 401

The error code returned.

ErrorMessage String You have no permission.

The error message returned.

HttpStatusCode Integer 200

The HTTP status code returned.

Success Boolean true

Indicates whether the request is successful.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListQualityResultsByEntity
&EndDate=2020-09-21 00:00:00
&EntityId=152322134
&PageNumber=1
&PageSize=10
&ProjectName=autotest
&StartDate=2020-09-20 00:00:00
&<Common request parameters>

Sample success responses

XML format

<RequestId>CBA58543-00D4-41****</RequestId>
<Data>
    <TotalCount>50</TotalCount>
    <PageSize>10</PageSize>
    <PageNumber>1</PageNumber>
    <RuleChecks>
        <Op>&amp;gt;</Op>
        <TaskId>16008552981681a0d6****</TaskId>
        <EndTime>1600704000000</EndTime>
        <DiscreteCheck>true</DiscreteCheck>
        <CheckerName>fulx</CheckerName>
        <ExpectValue>200</ExpectValue>
        <ProjectName>autotest</ProjectName>
        <RuleId>123123232</RuleId>
        <WarningThreshold>0.1</WarningThreshold>
        <WhereCondition>id&amp;gt;0</WhereCondition>
        <BeginTime>1600704000000</BeginTime>
        <CheckResultStatus>0</CheckResultStatus>
        <MatchExpression>ds=$[yyyymmdd]</MatchExpression>
        <UpperValue>25555</UpperValue>
        <IsPrediction>true</IsPrediction>
        <CheckResult>0</CheckResult>
        <TemplateName>Compare the Number of Unique Field Values Against Expectation</TemplateName>
        <TimeCost>202s</TimeCost>
        <FixedCheck>false</FixedCheck>
        <MethodName>count_distinct</MethodName>
        <ResultString>test</ResultString>
        <Property>type</Property>
        <DateType>YMD</DateType>
        <BizDate>1600704000000</BizDate>
        <TemplateId>5</TemplateId>
        <RuleName>Test</RuleName>
        <Comment>Test rule</Comment>
        <CriticalThreshold>0.5</CriticalThreshold>
        <ExternalId>1112323123</ExternalId>
        <Trend>abs</Trend>
        <CheckerType>0</CheckerType>
        <ExternalType>CWF2</ExternalType>
        <CheckerId>7</CheckerId>
        <EntityId>15432322</EntityId>
        <TableName>dual</TableName>
        <BlockType>0</BlockType>
        <Id>121212121</Id>
        <ActualExpression>ds=20200912</ActualExpression>
        <LowerValue>232222</LowerValue>
    </RuleChecks>
    <RuleChecks>
        <SampleValue>
            <SingleCheckResult>0</SingleCheckResult>
            <Value>19</Value>
            <BizDate>1600704000000</BizDate>
            <DiscreteProperty>0</DiscreteProperty>
            <Threshold>0.5</Threshold>
        </SampleValue>
        <SampleValue>
            <Value>19</Value>
            <BizDate>1600704000000</BizDate>
            <DiscreteProperty>0</DiscreteProperty>
        </SampleValue>
        <ReferenceValue>
            <SingleCheckResult>0</SingleCheckResult>
            <Value>19</Value>
            <BizDate>1600704000000</BizDate>
            <DiscreteProperty>0</DiscreteProperty>
            <Threshold>0.5</Threshold>
        </ReferenceValue>
        <ReferenceValue>
            <Value>19</Value>
            <BizDate>1600704000000</BizDate>
            <DiscreteProperty>0</DiscreteProperty>
        </ReferenceValue>
    </RuleChecks>
</Data>

JSON format

{
    "RequestId": "CBA58543-00D4-41****",
    "Data": {
        "TotalCount": 50,
        "PageSize": 10,
        "PageNumber": 1,
        "RuleChecks": [
            {
                "Op": "&gt;",
                "TaskId": "16008552981681a0d6****",
                "EndTime": 1600704000000,
                "DiscreteCheck": true,
                "CheckerName": "fulx",
                "ExpectValue": 200,
                "ProjectName": "autotest",
                "RuleId": 123123232,
                "WarningThreshold": 0.1,
                "WhereCondition": "id&gt;0",
                "BeginTime": 1600704000000,
                "CheckResultStatus": 0,
                "MatchExpression": "ds=$[yyyymmdd]",
                "UpperValue": 25555,
                "IsPrediction": true,
                "CheckResult": 0,
                "TemplateName": "Compare the Number of Unique Field Values Against Expectation",
                "TimeCost": "202s",
                "FixedCheck": false,
                "MethodName": "count_distinct",
                "ResultString": "test",
                "Property": "type",
                "DateType": "YMD",
                "BizDate": 1600704000000,
                "TemplateId": 5,
                "RuleName": "Test",
                "Comment": "Test rule",
                "CriticalThreshold": 0.5,
                "ExternalId": 1112323123,
                "Trend": "abs",
                "CheckerType": 0,
                "ExternalType": "CWF2",
                "CheckerId": 7,
                "EntityId": 15432322,
                "TableName": "dual",
                "BlockType": 0,
                "Id": 121212121,
                "ActualExpression": "ds=20200912",
                "LowerValue": 232222
            },
            {
                "SampleValue": [
                    {
                        "SingleCheckResult": 0,
                        "Value": 19,
                        "BizDate": 1600704000000,
                        "DiscreteProperty": 0,
                        "Threshold": 0.5
                    },
                    {
                        "Value": 19,
                        "BizDate": 1600704000000,
                        "DiscreteProperty": 0
                    }
                ],
                "ReferenceValue": [
                    {
                        "SingleCheckResult": 0,
                        "Value": 19,
                        "BizDate": 1600704000000,
                        "DiscreteProperty": 0,
                        "Threshold": 0.5
                    },
                    {
                        "Value": 19,
                        "BizDate": 1600704000000,
                        "DiscreteProperty": 0
                    }
                ]
            }
        ]
    }
}

Error codes

For a list of error codes, visit the API Error Center.