-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][Docs] Perfect metric docs (#25)
- Loading branch information
Showing
48 changed files
with
1,820 additions
and
46 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
docs/04-features/02-metric/01-single-table-metric/10-column-not-in-enums.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
id: 'column-not-in-enums' | ||
title: 'column_not_in_enums' | ||
--- | ||
## 使用方法 | ||
- 点击创建规则作业,选择数据质量作业 | ||
- 进入作业页面选择 枚举值[不在]检查 规则 | ||
- 选择要检查的数据源信息 | ||
|
||
## 参数介绍 | ||
### Options | ||
|
||
| name | type | required | default value | | ||
|:----------------------------:|:------:|:----------:|:-------------:| | ||
| [database](#database-string) | string | yes | - | | ||
| [table](#table-string) | string | yes | - | | ||
| [column](#column-string) | string | yes | - | | ||
| [enum_list](#enum_list-string) | string | yes | - | | ||
|
||
#### database [string] | ||
源表数据库名 | ||
#### table [string] | ||
源表数据库中的表名 | ||
#### column [string] | ||
要检查的列 | ||
#### enum_list [string] | ||
枚举值列表,用,隔开 | ||
|
||
### 配置文件例子 | ||
``` | ||
{ | ||
"metricType": "column_in_enums", | ||
"metricParameter": { | ||
"database": "datavines", | ||
"table": "dv_catalog_entity_instance", | ||
"column": "type" | ||
"enum_list":"'database','table'" | ||
} | ||
} | ||
``` | ||
|
||
### 检查过程中自动生成的 `SQL` 语句 | ||
|
||
检查过程会用到的一些自动生成的参数,用于区分各个检查规则。 | ||
- uniqueKey | ||
- 会根据每个规则的配置信息生成一个唯一键值 | ||
- invalidate_items_table | ||
- 会创建一个视图用于存储中间表数据,中间表数据一般为命中规则的数据,即为错误数据,该视图的名字生成规则为 invalidate_items_${uniqueKey} | ||
|
||
中间表 invalidate_items_${uniqueKey} | ||
``` | ||
select * from ${table} where (${column} not in ( ${enum_list} ) or ${column} is null) and ${filter} | ||
``` | ||
计算实际值的 `SQL`,输出的实际值是列的值不在枚举值列表中的列的行数 | ||
``` | ||
select count(1) as actual_value_"+ uniqueKey +" from ${invalidate_items_table} | ||
``` | ||
|
||
## 使用案例 | ||
|
||
### 场景 | ||
... | ||
|
||
### 思路 | ||
... | ||
|
||
### 步骤 | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
docs/04-features/02-metric/01-single-table-metric/12-column-match-not-regex.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
id: 'column-match-not-regex' | ||
title: 'column_match_not_regex' | ||
--- | ||
## 使用方法 | ||
- 点击创建规则作业,选择数据质量作业 | ||
- 进入作业页面选择 正则表达式[不匹配]检查 规则 | ||
- 选择要检查的数据源信息 | ||
|
||
## 参数介绍 | ||
### Options | ||
|
||
| name | type | required | default value | | ||
|:----------------------------:|:------:|:----------:|:-------------:| | ||
| [database](#database-string) | string | yes | - | | ||
| [table](#table-string) | string | yes | - | | ||
| [column](#column-string) | string | yes | - | | ||
| [regexp](#regexp-string) | string | yes | - | | ||
|
||
#### database [string] | ||
源表数据库名 | ||
#### table [string] | ||
源表数据库中的表名 | ||
#### column [string] | ||
要检查的列 | ||
#### regexp [string] | ||
正则表达式 | ||
|
||
### 配置文件例子 | ||
``` | ||
{ | ||
"metricType": "column_in_enums", | ||
"metricParameter": { | ||
"database": "datavines", | ||
"table": "dv_catalog_entity_instance", | ||
"column": "type" | ||
"regexp":"\d" | ||
} | ||
} | ||
``` | ||
|
||
### 检查过程中自动生成的 `SQL` 语句 | ||
|
||
检查过程会用到的一些自动生成的参数,用于区分各个检查规则。 | ||
- uniqueKey | ||
- 会根据每个规则的配置信息生成一个唯一键值 | ||
- invalidate_items_table | ||
- 会创建一个视图用于存储中间表数据,中间表数据一般为命中规则的数据,即为错误数据,该视图的名字生成规则为 invalidate_items_${uniqueKey} | ||
|
||
中间表 invalidate_items_${uniqueKey} | ||
``` | ||
select * from ${table} where (${column} not regexp '${regexp}') and ${filter} | ||
``` | ||
计算实际值的 `SQL`,输出的实际值是列的值没有匹配上正则表达式的列的行数 | ||
``` | ||
select count(1) as actual_value_"+ uniqueKey +" from ${invalidate_items_table} | ||
``` | ||
|
||
## 使用案例 | ||
|
||
### 场景 | ||
... | ||
|
||
### 思路 | ||
... | ||
|
||
### 步骤 | ||
... |
68 changes: 68 additions & 0 deletions
68
docs/04-features/02-metric/01-single-table-metric/13-column-match-regex.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
id: 'column-match-regex' | ||
title: 'column_match_regex' | ||
--- | ||
## 使用方法 | ||
- 点击创建规则作业,选择数据质量作业 | ||
- 进入作业页面选择 正则表达式[匹配]检查 规则 | ||
- 选择要检查的数据源信息 | ||
|
||
## 参数介绍 | ||
### Options | ||
|
||
| name | type | required | default value | | ||
|:----------------------------:|:------:|:----------:|:-------------:| | ||
| [database](#database-string) | string | yes | - | | ||
| [table](#table-string) | string | yes | - | | ||
| [column](#column-string) | string | yes | - | | ||
| [regexp](#regexp-string) | string | yes | - | | ||
|
||
#### database [string] | ||
源表数据库名 | ||
#### table [string] | ||
源表数据库中的表名 | ||
#### column [string] | ||
要检查的列 | ||
#### regexp [string] | ||
正则表达式 | ||
|
||
### 配置文件例子 | ||
``` | ||
{ | ||
"metricType": "column_in_enums", | ||
"metricParameter": { | ||
"database": "datavines", | ||
"table": "dv_catalog_entity_instance", | ||
"column": "type" | ||
"regexp":"\d" | ||
} | ||
} | ||
``` | ||
|
||
### 检查过程中自动生成的 `SQL` 语句 | ||
|
||
检查过程会用到的一些自动生成的参数,用于区分各个检查规则。 | ||
- uniqueKey | ||
- 会根据每个规则的配置信息生成一个唯一键值 | ||
- invalidate_items_table | ||
- 会创建一个视图用于存储中间表数据,中间表数据一般为命中规则的数据,即为错误数据,该视图的名字生成规则为 invalidate_items_${uniqueKey} | ||
|
||
中间表 invalidate_items_${uniqueKey} | ||
``` | ||
select * from ${table} where (${column} regexp '${regexp}') and ${filter} | ||
``` | ||
计算实际值的 `SQL`,输出的实际值是列的值匹配上正则表达式的列的行数 | ||
``` | ||
select count(1) as actual_value_"+ uniqueKey +" from ${invalidate_items_table} | ||
``` | ||
|
||
## 使用案例 | ||
|
||
### 场景 | ||
... | ||
|
||
### 思路 | ||
... | ||
|
||
### 步骤 | ||
... |
58 changes: 58 additions & 0 deletions
58
docs/04-features/02-metric/01-single-table-metric/14-column-max.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
id: 'column-max' | ||
title: 'column_max' | ||
--- | ||
## 使用方法 | ||
- 点击创建规则作业,选择数据质量作业 | ||
- 进入作业页面选择 最大值检查 规则 | ||
- 选择要检查的数据源信息 | ||
|
||
## 参数介绍 | ||
### Options | ||
|
||
| name | type | required | default value | | ||
|:----------------------------:|:------:|:----------:|:-------------:| | ||
| [database](#database-string) | string | yes | - | | ||
| [table](#table-string) | string | yes | - | | ||
| [column](#column-string) | string | yes | - | | ||
|
||
#### database [string] | ||
源表数据库名 | ||
#### table [string] | ||
源表数据库中的表名 | ||
#### column [string] | ||
要检查的列 | ||
|
||
### 配置文件例子 | ||
``` | ||
{ | ||
"metricType": "column_avg", | ||
"metricParameter": { | ||
"database": "datavines", | ||
"table": "dv_catalog_entity_instance", | ||
"column": "type" | ||
} | ||
} | ||
``` | ||
|
||
### 检查过程中自动生成的 `SQL` 语句 | ||
|
||
检查过程会用到的一些自动生成的参数,用于区分各个检查规则。 | ||
- uniqueKey | ||
- 会根据每个规则的配置信息生成一个唯一键值 | ||
|
||
计算实际值的 `SQL` | ||
``` | ||
select max(${column}) as actual_value_${uniqueKey} from ${table} where ${filter} | ||
``` | ||
|
||
## 使用案例 | ||
|
||
### 场景 | ||
... | ||
|
||
### 思路 | ||
... | ||
|
||
### 步骤 | ||
... |
Oops, something went wrong.