Shadow

    Notes

    • Duplicate cannot be created
    • resourceMapping specifies the mapping relationship between the source database and the shadow library. You need to use the resource managed by RDL, please refer to
    • 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
    • shadowTableRule can be reused by different shadowRuleDefinition, so when executing , the corresponding shadowTableRule will not be removed
    • shadowAlgorithm can be reused by different shadowTableRule, so when executing ALTER SHADOW RULE, the corresponding shadowAlgorithm will not be removed

    Example

    1. SOURCE=demo_ds,
    2. SHADOW=demo_ds_shadow,
    3. t_order((simple_hint_algorithm, TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"="true", "foo"="bar"))),(TYPE(NAME="REGEX_MATCH", PROPERTIES("operation"="insert","column"="user_id", "regex"='[1]')))),
    4. t_order_item((TYPE(NAME="VALUE_MATCH", PROPERTIES("operation"="insert","column"="user_id", "value"='1')))));
    5. ALTER SHADOW RULE shadow_rule(
    6. SOURCE=demo_ds,
    7. SHADOW=demo_ds_shadow,
    8. t_order_item((TYPE(NAME="VALUE_MATCH", PROPERTIES("operation"="insert","column"="user_id", "value"='1')))));
    9. (simple_hint_algorithm, TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"="true", "foo"="bar"))),
    10. (user_id_match_algorithm, TYPE(NAME="REGEX_MATCH",PROPERTIES("operation"="insert", "column"="user_id", "regex"='[1]')));
    11. ALTER SHADOW ALGORITHM
    12. (simple_hint_algorithm, TYPE(NAME="SIMPLE_HINT", PROPERTIES("shadow"="false", "foo"="bar"))),
    13. (user_id_match_algorithm, TYPE(NAME="VALUE_MATCH",PROPERTIES("operation"="insert", "column"="user_id", "value"='1')));
    14. DROP SHADOW RULE shadow_rule;
    15. DROP SHADOW ALGORITHM simple_hint_algorithm;
    16. CREATE DEFAULT SHADOW ALGORITHM NAME = simple_hint_algorithm;