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.

    1. INSERT

      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.

    1. Take the column type as TinyInt as an example:

    2. Take the column type as Decimal(1,0) as an example

      Primitive Data TypesExamples of Primitive DataConverted to DecimalStrict ModeResult
      Null\NnullOn or OffNULL
      non-null valueaaaNULLonillegal value (filtered)
      non-null valueaaaNULLoffNULL
      non-null value1 or 101 or 10on or offimport correctly

      Description:

      1. Columns in the table allow to import null values
      2. 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.