This statement creates a SQL blocking rule, which is only used to restrict query statements, not to restrict the execution of explian statements.

    Supports configuring SQL blacklists by user:

    • Refuse to specify SQL by regular matching
    • Check if a query reaches one of these limits by setting partition_num, tablet_num, cardinality
      • partition_num, tablet_num, cardinality can be set together, once a query reaches one of these limits, the query will be intercepted

    Parameter Description:

    • sql: matching rule (based on regular matching, special characters need to be translated,for exampleuseselect \\*), optional, the default value is “NULL”
    • sqlHash: sql hash value, used for exact matching, we will print this value in fe.audit.log, optional, this parameter and sql can only be selected one, the default value is “NULL”
    • tablet_num: The maximum number of tablets that a scanning node will scan, the default value is 0L
    • cardinality: the rough scan line number of a scan node, the default value is 0L
    • global: Whether to take effect globally (all users), the default is false
    • enable: whether to enable blocking rules, the default is true
    1. Create a block rule named test_rule

      1. CREATE SQL_BLOCK_RULE test_rule
      2. PROPERTIES(
      3. "global"="false",
      4. "enable"="true"

      When we execute the sql we just defined in the rule, an exception error will be returned. The example is as follows:

      1. CREATE SQL_BLOCK_RULE test_rule2
      2. "partition_num" = "30",
      3. "cardinality" = "10000000000",
      4. "global" = "false",
      5. "enable" = "true"
    2. Create SQL BLOCK RULE with special chars

    1. CREATE, SQL_BLCOK_RULE