查詢品質規則範本詳情。
目前該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 |
The metrics used for sampling. Valid values:
|
Max |
| MetricParameters |
string |
The parameters required for sampling. |
{"SQL": "select count(1) from table;"} |
| SettingConfig |
string |
The statements that are used to configure the parameters required for sampling before you execute the sampling statements. The statements can be up to 1,000 characters in length. Only the MaxCompute database is supported. |
SET odps.sql.udf.timeout=600s; SET odps.sql.python.version=cp27; |
| CheckingConfig |
object |
樣本校驗設定。 |
|
| Type |
string |
The threshold calculation method. Valid values:
|
Fixed |
| ReferencedSamplesFilter |
string |
The method that is used to query the referenced samples. To obtain some types of thresholds, you need to query reference samples and perform aggregate operations on the reference values. In this example, an expression is used to indicate the query method of referenced samples. |
{ "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"
}
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。