查询质量规则模版详情。
目前该API接口已标记为弃用,推荐使用替代API:dataworks-public(2024-05-18) - GetDataQualityTemplate。
接口说明
需要购买 DataWorks 基础版及以上版本才能使用
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| Code |
string |
是 |
规则模版 Code。 |
USER_DEFINED:123 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回值。 |
||
| RequestId |
string |
API 请求 ID。 |
691CA452-D37A-4E**** |
| DataQualityRuleTemplate |
object |
规则模版详情。 |
|
| Code |
string |
规则模版 Code。 |
USER_DEFINED:123 |
| Name |
string |
规则模板名称,数字、英文字母、汉字、半角全角标点符号组合,最长 512 个字符。 |
Table row Count Verification |
| ProjectId |
integer |
DataWorks 工作空间 ID。 |
4020 |
| SamplingConfig |
object |
样本采集所需的设置。 |
|
| Metric |
string |
采样的指标名称:
|
Max |
| MetricParameters |
string |
样本采集时,所需的参数。 |
{"SQL": "select count(1) from table;"} |
| SettingConfig |
string |
具体执行采样语句前,插入执行的一些运行时参数设置语句,最长 1000 个字符。目前只支持 MaxCompute。 |
SET odps.sql.udf.timeout=600s; SET odps.sql.python.version=cp27; |
| CheckingConfig |
object |
样本校验设置。 |
|
| Type |
string |
阈值计算方式:
|
Fixed |
| ReferencedSamplesFilter |
string |
有些类型的阈值需要查询出一些参考样本,然后对参考样本的值进行汇总得出进行比较的阈值,这里使用一个表达式来表示参考样本的查询方式。 |
{ "bizdate": [ "-1", "-7", "-1m" ] } |
| VisibleScope |
string |
模板的可用范围:
|
Project |
| DirectoryPath |
string |
自定义模板被存放的类目目录,斜线分隔层级。每个层级名称最长 1024 个字符,由不能包含空白字符、不能包含斜线。 |
/ods/order_data |
示例
正常返回示例
JSON格式
{
"RequestId": "691CA452-D37A-4E****",
"DataQualityRuleTemplate": {
"Code": "USER_DEFINED:123",
"Name": "Table row Count Verification",
"ProjectId": 4020,
"SamplingConfig": {
"Metric": "Max",
"MetricParameters": "{\"SQL\": \"select count(1) from table;\"}",
"SettingConfig": "SET odps.sql.udf.timeout=600s; \nSET odps.sql.python.version=cp27;\n"
},
"CheckingConfig": {
"Type": "Fixed",
"ReferencedSamplesFilter": "{ \"bizdate\": [ \"-1\", \"-7\", \"-1m\" ] }\n"
},
"VisibleScope": "Project",
"DirectoryPath": "/ods/order_data"
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。