调用ListQualityResultsByEntity,根据分区表达式查询历史校验结果。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListQualityResultsByEntity |
要执行的操作。 |
EndDate | String | 是 | 2020-09-21 00:00:00 |
查询校验结果的截止时间,格式为yyyy-MM-dd HH:mm:ss。 |
EntityId | Integer | 是 | 152322134 |
分区表达式ID。您可以调用GetQualityEntity获取分区表达式ID。 |
PageNumber | Integer | 是 | 1 |
页码数。 |
PageSize | Integer | 是 | 10 |
每页显示的条数,默认为10条,最大100条。 |
ProjectName | String | 是 | autotest |
引擎或者数据源的名称。您可以从数据源配置中获取名称。 |
StartDate | String | 是 | 2020-09-20 00:00:00 |
查询校验结果的开始时间,格式为yyyy-MM-dd HH:mm:ss。 |
RegionId | String | 否 | cn-hangzhou |
地域信息,通常为服务所在的地域。例如,华东2(上海)为cn-shanghai,华北3(张家口)为cn-zhangjiakou。您无需填写RegionId,会根据调用的Endpoint自动解析。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | CBA58543-00D4-41**** |
请求ID。 |
Data | Struct |
校验结果的顶层结构体。 |
|
PageNumber | Integer | 1 |
页码数。 |
PageSize | Integer | 10 |
每页显示的条数,默认为10条,最大100条。 |
RuleChecks | Array of RuleChecks |
校验结果的列表。 |
|
ActualExpression | String | ds=20200912 |
被校验的数据源表的实际分区。 |
BeginTime | Long | 1600704000000 |
执行校验操作的开始时间。 |
BizDate | Long | 1600704000000 |
业务日期。如果被校验的业务主体为离线数据,则业务日期通常为执行校验操作的前一天。 |
BlockType | Integer | 0 |
校验规则的强弱。强弱表示规则的重要程度。取值如下:
|
CheckResult | Integer | 0 |
校验结果:
|
CheckResultStatus | Integer | 0 |
校验结果状态:
|
CheckerId | Integer | 7 |
校验器的ID。 |
CheckerName | String | fulx |
校验器的名称。 |
CheckerType | Integer | 0 |
校验类型。取值如下:
|
Comment | String | 规则的描述信息。 |
校验规则的描述。 |
CriticalThreshold | Float | 0.5 |
红色阈值。表示与样本预期的偏离程度。您可以根据业务需求自定义该阈值。使用强规则并触发红色阈值,会阻塞调度任务。 |
DateType | String | YMD |
调度周期的类型。通常为YMD,即年任务、月任务、天任务。 |
DiscreteCheck | Boolean | true |
是否为离散校验。取值如下:
|
EndTime | Long | 1600704000000 |
查询校验结果的截止时间。 |
EntityId | Integer | 15432322 |
分区表达式ID。 |
ExpectValue | Float | 200 |
期望值。 |
ExternalId | String | 1112323123 |
调度任务的节点ID。 |
ExternalType | String | CWF2 |
调度系统的类型。目前仅支持CWF。 |
FixedCheck | Boolean | false |
是否为固定值校验。取值如下:
|
Id | Integer | 121212121 |
主键ID。 |
IsPrediction | Boolean | true |
是否为预测的结果。取值如下:
|
LowerValue | Float | 2344 |
预测结果的下限。根据您设置的阈值自动生成。 |
MatchExpression | String | ds=$[yyyymmdd] |
分区表达式。 |
MethodName | String | count_distinct |
采集样本数据的方法。包括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、table_count-count_distinct等。 |
Op | String | > |
比较符。 |
ProjectName | String | autotest |
需要进行数据质量校验的引擎或者数据源名称。 |
Property | String | type |
规则属性的字段,即被校验数据源表的column名称。 |
ReferenceValue | Array of ReferenceValue |
历史样本值。 |
|
BizDate | String | 2020-12-03 |
业务日期。如果被校验的业务主体为离线数据,则业务日期通常为执行校验操作的前一天。 |
DiscreteProperty | String | 0 |
通过group by分组后的样本字段取值。例如group by性别字段,则DiscreteProperty为男生、女生和null。 |
SingleCheckResult | Integer | 0 |
校验结果。 |
Threshold | Float | 0.5 |
阈值。 |
Value | Float | 19 |
校验值。 |
ResultString | String | test |
校验结果的字符串形式。 |
RuleId | Integer | 123123232 |
规则ID。 |
RuleName | String | 规则的名称。 |
规则的名称。 |
SampleValue | Array of SampleValue |
当前使用的样本。 |
|
BizDate | String | 2020-12-03 |
业务日期。如果被校验的业务主体为离线数据,则业务日期通常为执行校验操作的前一天。 |
DiscreteProperty | String | 0 |
通过group by分组后的样本字段取值。例如group by性别字段,则DiscreteProperty为男生、女生和null。 |
Value | Float | 19 |
当前样本值。 |
TableName | String | dual |
进行校验的表名称。 |
TaskId | String | 16008552981681a0d6**** |
校验任务的ID。 |
TemplateId | Integer | 5 |
使用的校验模板的ID。 |
TemplateName | String | 字段唯一值个数期望值校验 |
使用的校验模板的名称。 |
TimeCost | String | 202 |
执行校验任务花费的时间,单位为秒。 |
Trend | String | abs |
校验结果的趋势。 |
UpperValue | Float | 25555 |
预测上限。设置阈值后自动生成。 |
WarningThreshold | Float | 0.1 |
橙色阈值。表示与样本预期的偏离程度,您可以根据业务需求自定义该阈值。 |
WhereCondition | String | id>0 |
校验任务使用的规则过滤条件。 |
TotalCount | Long | 50 |
数据的总记录数。 |
ErrorCode | String | 401 |
错误码。 |
ErrorMessage | String | You have no permission. |
错误信息。 |
HttpStatusCode | Integer | 200 |
HTTP状态码。 |
Success | Boolean | true |
请求是否成功。 |
示例
请求示例
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
&<公共请求参数>
正常返回示例
XML
格式
<RequestId>CBA58543-00D4-41****</RequestId>
<Data>
<TotalCount>50</TotalCount>
<PageSize>10</PageSize>
<PageNumber>1</PageNumber>
<RuleChecks>
<Op>&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&gt;0</WhereCondition>
<BeginTime>1600704000000</BeginTime>
<CheckResultStatus>0</CheckResultStatus>
<MatchExpression>ds=$[yyyymmdd]</MatchExpression>
<UpperValue>25555</UpperValue>
<IsPrediction>true</IsPrediction>
<CheckResult>0</CheckResult>
<TemplateName>字段唯一值个数期望值校验</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>测试规则</RuleName>
<Comment>测试规则的描述</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>
</QualityResults>
JSON
格式
{
"RequestId": "CBA58543-00D4-41****",
"Data": {
"TotalCount": 50,
"PageSize": 10,
"PageNumber": 1,
"RuleChecks": [
{
"Op": ">",
"TaskId": "16008552981681a0d6****",
"EndTime": 1600704000000,
"DiscreteCheck": true,
"CheckerName": "fulx",
"ExpectValue": 200,
"ProjectName": "autotest",
"RuleId": 123123232,
"WarningThreshold": 0.1,
"WhereCondition": "id>0",
"BeginTime": 1600704000000,
"CheckResultStatus": 0,
"MatchExpression": "ds=$[yyyymmdd]",
"UpperValue": 25555,
"IsPrediction": true,
"CheckResult": 0,
"TemplateName": "字段唯一值个数期望值校验",
"TimeCost": "202s",
"FixedCheck": false,
"MethodName": "count_distinct",
"ResultString": "test",
"Property": "type",
"DateType": "YMD",
"BizDate": 1600704000000,
"TemplateId": 5,
"RuleName": "测试规则",
"Comment": "测试规则的描述",
"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
}
]
}
]
}
}
错误码
访问错误中心查看更多错误码。
在文档使用中是否遇到以下问题
更多建议
匿名提交