import strict mode
This document mainly explains how to set strict mode, and the impact of strict mode.
Strict mode is all False by default, i.e. off.
Different import methods set strict mode in different ways.
-
Set via :
The role of strict mode
Strict mode means strict filtering of column type conversions during import.
The strict filtering strategy is as follows:
For column type conversion, if strict mode is turned on, the wrong data will be filtered. The wrong data here refers to: the original data is not , but the result is null
after column type conversion.
For an imported column type that contains range restrictions, if the original data can pass the type conversion normally, but cannot pass the range restrictions, strict mode will not affect it. For example: if the type is and the original data is 10, it belongs to the range that can be converted by type but is not within the scope of the column declaration. This kind of data strict has no effect on it.
Take the column type as TinyInt as an example:
Take the column type as Decimal(1,0) as an example
Primitive Data Types Examples of Primitive Data Converted to Decimal Strict Mode Result Null \N null On or Off NULL non-null value aaa NULL on illegal value (filtered) non-null value aaa NULL off NULL non-null value 1 or 10 1 or 10 on or off import correctly Description:
- Columns in the table allow to import null values
- Although
10
is an out-of-range value, because its type conforms to the requirements of decimal, strict mode does not affect it.10
will eventually be filtered in other import processing flows. But not filtered by strict mode.