调用ListQualityResultsByEntity,根据分区表达式查询历史校验结果。
目前该API接口已标记为弃用,推荐使用替代API:dataworks-public(2024-05-18) - ListDataQualityScanRuns。
接口说明
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| EntityId |
integer |
是 |
分区表达式 ID。您可以调用 GetQualityEntity 获取分区表达式 ID。 |
15232 |
| StartDate |
string |
是 |
业务日期起始时间,格式为 yyyy-MM-dd HH:mm:ss。 |
2020-09-20 00:00:00 |
| EndDate |
string |
是 |
业务日期截止时间,格式为 yyyy-MM-dd HH:mm:ss。 |
2020-09-21 00:00:00 |
| PageSize |
integer |
是 |
每页显示的条数,默认为 10 条,最大 20 条。 |
10 |
| PageNumber |
integer |
是 |
页码数。 |
1 |
| ProjectName |
string |
是 |
引擎或者数据源的名称。您可以从数据源配置中获取名称。 |
autotest |
| ProjectId |
integer |
是 |
DataWorks 项目空间 ID。 |
12345 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
校验结果 |
||
| HttpStatusCode |
integer |
HTTP 状态码。 |
200 |
| ErrorMessage |
string |
错误信息。 |
You have no permission. |
| RequestId |
string |
请求 ID。 |
CBA58543-00D4-41**** |
| Success |
boolean |
请求是否成功。 |
true |
| ErrorCode |
string |
错误码。 |
401 |
| Data |
object |
校验结果的顶层结构体。 |
|
| PageNumber |
integer |
页码数。 |
1 |
| PageSize |
integer |
每页显示的条数,默认为 10 条,最大 100 条。 |
10 |
| TotalCount |
integer |
数据的总记录数。 |
50 |
| RuleChecks |
array<object> |
校验结果的列表。 |
|
|
array<object> |
校验结果 |
||
| BlockType |
integer |
校验规则的强弱。强弱表示规则的重要程度。取值如下:
|
0 |
| WarningThreshold |
number |
橙色阈值。表示与样本预期的偏离程度,您可以根据业务需求自定义该阈值。 |
0.1 |
| Property |
string |
规则属性的字段,即被校验数据源表的 column 名称。 |
type |
| TableName |
string |
进行校验的表名称。 |
dual |
| Comment |
string |
校验规则的描述。 |
The description of the rule. |
| CheckResultStatus |
integer |
校验结果状态参数与产品界面中的状态信息一致,取值有以下几种:
|
0 |
| TemplateName |
string |
使用的校验模板的名称。 |
Expected value verification |
| CheckerName |
string |
校验器的名称。 |
fulx |
| RuleId |
integer |
规则 ID。 |
123123232 |
| FixedCheck |
boolean |
是否为固定值校验。取值如下:
|
false |
| Op |
string |
比较符。 |
> |
| UpperValue |
number |
预测上限。设置阈值后自动生成。 |
25555 |
| ActualExpression |
string |
被校验的数据源表的实际分区。 |
ds=20200912 |
| ExternalId |
string |
调度任务的节点 ID。 |
1112323123 |
| TimeCost |
string |
执行校验任务花费的时间,单位为秒。 |
202 |
| Trend |
string |
校验结果的趋势。 |
abs |
| ExternalType |
string |
调度系统的类型。目前仅支持 CWF。 |
CWF2 |
| BizDate |
integer |
业务日期。如果被校验的业务主体为离线数据,则业务日期通常为执行校验操作的前一天。 |
1600704000000 |
| CheckResult |
integer |
校验结果参数的结果通常与 CheckResultStatus 一致,取值有以下几种:
|
0 |
| ResultString |
string |
校验结果的字符串形式。 |
test |
| MatchExpression |
string |
分区表达式。 |
ds=$[yyyymmdd] |
| CheckerType |
integer |
校验类型。取值如下:
|
1 |
| ProjectName |
string |
需要进行数据质量校验的引擎或者数据源名称。 |
autotest |
| BeginTime |
integer |
执行校验操作的开始时间。 |
1600704000000 |
| DateType |
string |
调度周期的类型。通常为 YMD,即年任务、月任务、天任务。 |
YMD |
| CriticalThreshold |
number |
红色阈值。表示与样本预期的偏离程度。您可以根据业务需求自定义该阈值。使用强规则并触发红色阈值,会阻塞调度任务。 |
0.5 |
| IsPrediction |
boolean |
是否为预测的结果。取值如下:
|
true |
| RuleName |
string |
规则的名称。 |
The name of the rule. |
| CheckerId |
integer |
校验器的 ID。 |
7 |
| DiscreteCheck |
boolean |
是否为离散校验。取值如下:
|
true |
| EndTime |
integer |
查询校验结果的截止时间。 |
1600704000000 |
| MethodName |
string |
采集样本数据的方法。包括 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 等。 |
count_distinct |
| LowerValue |
number |
预测结果的下限。根据您设置的阈值自动生成。 |
2344 |
| EntityId |
integer |
分区表达式 ID。 |
15432322 |
| WhereCondition |
string |
校验任务使用的规则过滤条件。 |
id>0 |
| ExpectValue |
number |
期望值。 |
200 |
| TemplateId |
integer |
使用的校验模板的 ID。 |
5 |
| TaskId |
string |
校验任务的 ID。 |
16008552981681a0d6**** |
| Id |
integer |
主键 ID。 |
121212121 |
| ReferenceValue |
array<object> |
历史样本值。 |
|
|
object |
校验结果 |
||
| DiscreteProperty |
string |
通过 group by 分组后的样本字段取值。例如 group by 性别字段,则 DiscreteProperty 为男生、女生和 null。 |
0 |
| Value |
number |
校验值。 |
19 |
| BizDate |
string |
业务日期。如果被校验的业务主体为离线数据,则业务日期通常为执行校验操作的前一天。 |
2020-12-03 |
| SingleCheckResult |
integer |
校验结果。 |
0 |
| Threshold |
number |
阈值。 |
0.5 |
| SampleValue |
array<object> |
当前使用的样本。 |
|
|
object |
校验结果 |
||
| DiscreteProperty |
string |
通过 group by 分组后的样本字段取值。例如 group by 性别字段,则 DiscreteProperty 为男生、女生和 null。 |
0 |
| BizDate |
string |
业务日期。如果被校验的业务主体为离线数据,则业务日期通常为执行校验操作的前一天。 |
2020-12-03 |
| Value |
number |
当前样本值。 |
19 |
示例
正常返回示例
JSON格式
{
"HttpStatusCode": 200,
"ErrorMessage": "You have no permission.",
"RequestId": "CBA58543-00D4-41****",
"Success": true,
"ErrorCode": "401",
"Data": {
"PageNumber": 1,
"PageSize": 10,
"TotalCount": 50,
"RuleChecks": [
{
"BlockType": 0,
"WarningThreshold": 0.1,
"Property": "type",
"TableName": "dual",
"Comment": "The description of the rule.",
"CheckResultStatus": 0,
"TemplateName": "Expected value verification",
"CheckerName": "fulx",
"RuleId": 123123232,
"FixedCheck": false,
"Op": ">",
"UpperValue": 25555,
"ActualExpression": "ds=20200912",
"ExternalId": "1112323123",
"TimeCost": "202",
"Trend": "abs",
"ExternalType": "CWF2",
"BizDate": 1600704000000,
"CheckResult": 0,
"ResultString": "test",
"MatchExpression": "ds=$[yyyymmdd]",
"CheckerType": 1,
"ProjectName": "autotest",
"BeginTime": 1600704000000,
"DateType": "YMD",
"CriticalThreshold": 0.5,
"IsPrediction": true,
"RuleName": "The name of the rule.",
"CheckerId": 7,
"DiscreteCheck": true,
"EndTime": 1600704000000,
"MethodName": "count_distinct",
"LowerValue": 2344,
"EntityId": 15432322,
"WhereCondition": "id>0",
"ExpectValue": 200,
"TemplateId": 5,
"TaskId": "16008552981681a0d6****",
"Id": 121212121,
"ReferenceValue": [
{
"DiscreteProperty": "0",
"Value": 19,
"BizDate": "2020-12-03",
"SingleCheckResult": 0,
"Threshold": 0.5
}
],
"SampleValue": [
{
"DiscreteProperty": "0",
"BizDate": "2020-12-03",
"Value": 19
}
]
}
]
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。