This is an automated email from the ASF dual-hosted git repository.
jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 4850873f66 [doc](sql-block-rule) add more example (#11416)
4850873f66 is described below
commit 4850873f66d7323d008aa594ddc267c9f16e3706
Author: Mingyu Chen <[email protected]>
AuthorDate: Tue Aug 2 18:39:13 2022 +0800
[doc](sql-block-rule) add more example (#11416)
sql-block-rule : add more example
---
.../Create/CREATE-SQL-BLOCK-RULE.md | 66 +++++++++++++---------
.../Create/CREATE-SQL-BLOCK-RULE.md | 66 +++++++++++++---------
2 files changed, 80 insertions(+), 52 deletions(-)
diff --git
a/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-SQL-BLOCK-RULE.md
b/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-SQL-BLOCK-RULE.md
index 0790a9a3fe..a513baa7ec 100644
---
a/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-SQL-BLOCK-RULE.md
+++
b/docs/en/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-SQL-BLOCK-RULE.md
@@ -61,35 +61,49 @@ Parameter Description:
1. Create a block rule named test_rule
- ```sql
- mysql> CREATE SQL_BLOCK_RULE test_rule
- -> PROPERTIES(
- -> "sql"="select \\* from order_analysis;",
- -> "global"="false",
- -> "enable"="true"
- -> );
- Query OK, 0 rows affected (0.01 sec)
- ````
-
- When we execute the sql we just defined in the rule, an exception error
will be returned. The example is as follows:
-
- ```sql
- mysql> select * from order_analysis;
- ERROR 1064 (HY000): errCode = 2, detailMessage = sql match regex sql block
rule: order_analysis_rule
- ````
+ ```sql
+ CREATE SQL_BLOCK_RULE test_rule
+ PROPERTIES(
+ "sql"="select \\* from order_analysis;",
+ "global"="false",
+ "enable"="true"
+ );
+ ````
+
+ When we execute the sql we just defined in the rule, an exception error
will be returned. The example is as follows:
+
+ ```sql
+ select * from order_analysis;
+ ERROR 1064 (HY000): errCode = 2, detailMessage = sql match regex sql block
rule: order_analysis_rule
+ ````
2. Create test_rule2, limit the maximum number of scanned partitions to 30,
and limit the maximum scan base to 10 billion rows. The example is as follows:
- ```sql
- mysql> CREATE SQL_BLOCK_RULE test_rule2
- -> PROPERTIES (
- -> "partition_num" = "30",
- -> "cardinality" = "10000000000",
- -> "global" = "false",
- -> "enable" = "true"
- -> );
- Query OK, 0 rows affected (0.01 sec)
- ````
+ ```sql
+ CREATE SQL_BLOCK_RULE test_rule2
+ PROPERTIES (
+ "partition_num" = "30",
+ "cardinality" = "10000000000",
+ "global" = "false",
+ "enable" = "true"
+ );
+ ````
+
+3. Create SQL BLOCK RULE with special chars
+
+ ```sql
+ CREATE SQL_BLOCK_RULE test_rule3
+ PROPERTIES
+ (
+ "sql" = "select count\\(1\\) from db1.tbl1"
+ );
+
+ CREATE SQL_BLOCK_RULE test_rule4
+ PROPERTIES
+ (
+ "sql" = "select \\* from db1.tbl1"
+ );
+ ```
### Keywords
diff --git
a/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-SQL-BLOCK-RULE.md
b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-SQL-BLOCK-RULE.md
index 17032f5afe..1c41aa8d56 100644
---
a/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-SQL-BLOCK-RULE.md
+++
b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-SQL-BLOCK-RULE.md
@@ -61,36 +61,50 @@ CREATE SQL_BLOCK_RULE rule_name
1. 创建一个名称为 test_rule 的阻止规则
- ```sql
- mysql> CREATE SQL_BLOCK_RULE test_rule
- -> PROPERTIES(
- -> "sql"="select \\* from order_analysis;",
- -> "global"="false",
- -> "enable"="true"
- -> );
- Query OK, 0 rows affected (0.01 sec)
- ```
-
- 当我们去执行刚才我们定义在规则里的sql时就会返回异常错误,示例如下:
-
- ```sql
- mysql> select * from order_analysis;
- ERROR 1064 (HY000): errCode = 2, detailMessage = sql match regex sql block
rule: order_analysis_rule
- ```
+ ```sql
+ CREATE SQL_BLOCK_RULE test_rule
+ PROPERTIES(
+ "sql"="select \\* from order_analysis;",
+ "global"="false",
+ "enable"="true"
+ );
+ ```
+
+ 当我们去执行刚才我们定义在规则里的sql时就会返回异常错误,示例如下:
+
+ ```sql
+ mysql> select * from order_analysis;
+ ERROR 1064 (HY000): errCode = 2, detailMessage = sql match regex sql block
rule: order_analysis_rule
+ ```
2. 创建 test_rule2,将最大扫描的分区数量限制在30个,最大扫描基数限制在100亿行,示例如下:
- ```sql
- mysql> CREATE SQL_BLOCK_RULE test_rule2
- -> PROPERTIES
+ ```sql
+ CREATE SQL_BLOCK_RULE test_rule2
+ PROPERTIES
(
- -> "partition_num" = "30",
- -> "cardinality" = "10000000000",
- -> "global" = "false",
- -> "enable" = "true"
- -> );
- Query OK, 0 rows affected (0.01 sec)
- ```
+ "partition_num" = "30",
+ "cardinality" = "10000000000",
+ "global" = "false",
+ "enable" = "true"
+ );
+ ```
+
+3. 创建包含特殊字符的 SQL BLOCK RULE:
+
+ ```sql
+ CREATE SQL_BLOCK_RULE test_rule3
+ PROPERTIES
+ (
+ "sql" = "select count\\(1\\) from db1.tbl1"
+ );
+
+ CREATE SQL_BLOCK_RULE test_rule4
+ PROPERTIES
+ (
+ "sql" = "select \\* from db1.tbl1"
+ );
+ ```
### Keywords
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]