-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change strategy of incorrect data (#1255)
This change adds a load property named strict_mode which is used to prohibit the incorrect data. When it is set to false, the incorrect data will be loaded by NULL just like before. When it is set to true, the incorrect data which belongs to a column without expr will be filtered. The strict_mode is supported in broker load v2 now. It will be supported in stream load later.
- Loading branch information
1 parent
6a54464
commit 5306212
Showing
11 changed files
with
137 additions
and
12 deletions.
There are no files selected for viewing
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
26 changes: 26 additions & 0 deletions
26
docs/documentation/cn/administrator-guide/load-data/broker-load-manual.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,26 @@ | ||
# broker load 使用说明 | ||
|
||
## properties | ||
|
||
### strict mode | ||
broker load导入可以开启strict mode模式。开启方式为 ```properties ("strict_mode" = "true")``` 。默认的 strict mode为开启。 | ||
|
||
*注意:strict mode 功能仅在新版本的broker load中有效,如果导入明确指定 ```"version" = "v1"``` 则没有此功能。* | ||
|
||
strict mode模式的意思是:对于导入过程中的列类型转换进行严格过滤。严格过滤的策略如下: | ||
|
||
对于列类型转换来说,如果 strict\_mode 为true,则错误的数据将被filter。这里的错误数据是指:原始数据并不为空值,在参与列类型转换后结果为空值的这一类数据。 | ||
|
||
对于导入的某列包含函数变换的,导入的值和函数的结果一致,strict 对其不产生影响。(其中 strftime 等 broker 系统支持的函数也属于这类)。 | ||
|
||
### strict mode 与 source data 的导入关系 | ||
|
||
这里以列类型为 int 来举例 | ||
注:当表中的列允许导入空值时 | ||
|
||
source data | source data example | string to int | strict_mode | load_data | ||
------------|---------------------|-----------------|--------------------|--------- | ||
空值 | \N | N/A | true or false | NULL | ||
not null | aaa | NULL | true | filtered | ||
not null | aaa | NULL | false | NULL | ||
not null | 1 | 1 | true or false | correct data |
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
Oops, something went wrong.