CREATE SHADOW ALGORITHM

Description

The CREATE SHADOW ALGORITHM syntax is used to create a shadow algorithm.

Syntax

  1. CreateShadowAlgorithm ::=
  2. 'CREATE' 'SHADOW' 'ALGORITHM' shadowAlgorithm ( ',' shadowAlgorithm )*
  3. shadowAlgorithm ::=
  4. '(' ( algorithmName ',' )? 'TYPE' '(' 'NAME' '=' shadowAlgorithmType ',' 'PROPERTIES' '(' ( 'key' '=' 'value' ( ',' 'key' '=' 'value' )* ) ')' ')'
  5. algorithmName ::=
  6. identifier
  7. shadowAlgorithmType ::=
  8. string

Supplement

  • shadowAlgorithm can act on multiple shadowTableRule at the same time;
  • If algorithmName is not specified, it will be automatically generated according to ruleName, tableName and shadowAlgorithmType;
  • shadowAlgorithmType currently supports VALUE_MATCH, REGEX_MATCH and SIMPLE_HINT.

Example

Create a shadow algorithm

  1. CREATE SHADOW ALGORITHM
  2. (simple_hint_algorithm, TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"="true", "foo"="bar"))),
  3. (user_id_match_algorithm, TYPE(NAME="REGEX_MATCH",PROPERTIES("operation"="insert", "column"="user_id", "regex"='[1]'))
  4. );

Reserved word

CREATE, SHADOW, ALGORITHM, TYPE, NAME, PROPERTIES