Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
KassieZ committed Feb 12, 2025
1 parent 3e720e8 commit eec1bad
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,46 @@ under the License.
-->



## Description

Modify SQL blocking rules to allow modification of each item such as sql/sqlHash/partition_num/tablet_num/cardinality/global/enable.
This statement is used to modify an SQL block rule.

## Syntax

grammar:

```sql
ALTER SQL_BLOCK_RULE rule_name
[PROPERTIES ("key"="value", ...)];
ALTER SQL_BLOCK_RULE <rule_name>
PROPERTIES (
-- property
<property>
-- Additional properties
[ , ... ]
)
```

illustrate:
## Required Parameters

- sql and sqlHash cannot be set at the same time. This means that if a rule sets sql or sqlHash, the other attribute cannot be modified;
- sql/sqlHash and partition_num/tablet_num/cardinality cannot be set at the same time. For example, if a rule sets partition_num, then sql or sqlHash cannot be modified;
**<rule_name>**

## Example
> The name of the rule.
1. Modify according to SQL properties
**<property>**

```sql
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
```
See the introduction of [CREATE SQL_BLOCK_RULE](../data-governance/CREATE-SQL_BLOCK_RULE.md) for details.

2. If a rule sets partition_num, then sql or sqlHash cannot be modified
## Permissions

```sql
ALTER SQL_BLOCK_RULE test_rule2 PROPERTIES("partition_num" = "10","tablet_num"="300","enable"="true")
```
The user executing this SQL command must have at least the following permissions:

## Keywords
| Permission | Object | Description |
| ------------ | ------ | ----------- |
| *ADMIN_PRIV* | Global | |

## Example

1. Modify the SQL and enable the rule

```text
ALTER,SQL_BLOCK_RULE
```

## Best Practice
```sql
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,44 @@ under the License.
-->



## 描述

修改 SQL 阻止规则,允许对 sql/sqlHash/partition_num/tablet_num/cardinality/global/enable 等每一项进行修改。
该语句用于修改 SQL 阻止规则

语法:
## 语法

```sql
ALTER SQL_BLOCK_RULE rule_name
[PROPERTIES ("key"="value", ...)];
ALTER SQL_BLOCK_RULE <rule_name>
PROPERTIES (
-- property
<property>
-- Additional properties
[ , ... ]
)
```

说明:
## 必选参数

- sql 和 sqlHash 不能同时被设置。这意味着,如果一个 rule 设置了 sql 或者 sqlHash,则另一个属性将无法被修改;
- sql/sqlHash 和 partition_num/tablet_num/cardinality 不能同时被设置。举个例子,如果一个 rule 设置了 partition_num,那么 sql 或者 sqlHash 将无法被修改;
**<rule_name>**

## 示例
> 规则的名字
1. 根据 SQL 属性进行修改
**<property>**

```sql
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
```
具体见[CREATE SQL_BLOCK_RULE](../data-governance/CREATE-SQL_BLOCK_RULE.md) 的介绍

2. 如果一个 rule 设置了 partition_num,那么 sql 或者 sqlHash 将无法被修改
## 权限控制

```sql
ALTER SQL_BLOCK_RULE test_rule2 PROPERTIES("partition_num" = "10","tablet_num"="300","enable"="true")
```
执行此 SQL 命令的用户必须至少具有以下权限:

## 关键词
| 权限 | 对象 | 说明 |
| :---------------- | :------------- | :------------ |
| *ADMIN_PRIV* | 全局 | |

```text
ALTER,SQL_BLOCK_RULE
```
## 示例

### 最佳实践
1. 修改 sql 并开启规则

```sql
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
```
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,42 @@ under the License.

## 描述

该语句用于修改 SQL 阻止规则

修改 SQL 阻止规则,允许对 sql/sqlHash/partition_num/tablet_num/cardinality/global/enable 等每一项进行修改。

语法:
## 语法

```sql
ALTER SQL_BLOCK_RULE rule_name
[PROPERTIES ("key"="value", ...)];
ALTER SQL_BLOCK_RULE <rule_name>
PROPERTIES (
-- property
<property>
-- Additional properties
[ , ... ]
)
```

说明:
- sql 和 sqlHash 不能同时被设置。这意味着,如果一个 rule 设置了 sql 或者 sqlHash,则另一个属性将无法被修改;
- sql/sqlHash 和 partition_num/tablet_num/cardinality 不能同时被设置。举个例子,如果一个 rule 设置了 partition_num,那么 sql 或者 sqlHash 将无法被修改;
## 必选参数

**<rule_name>**

## 示例
> 规则的名字
1. 根据 SQL 属性进行修改
**<property>**

```sql
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
```
具体见 CREATE SQL_BLOCK_RULE 的介绍

2. 如果一个 rule 设置了 partition_num,那么 sql 或者 sqlHash 将无法被修改
## 权限控制

```sql
ALTER SQL_BLOCK_RULE test_rule2 PROPERTIES("partition_num" = "10","tablet_num"="300","enable"="true")
```
执行此 SQL 命令的用户必须至少具有以下权限:

## 关键词
| 权限 | 对象 | 说明 |
| :---------------- | :------------- | :------------ |
| *ADMIN_PRIV* | 全局 | |

```text
ALTER,SQL_BLOCK_RULE
```
## 示例

## 最佳实践
1. 修改 sql 并开启规则

```sql
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,44 @@ under the License.
-->



## 描述

修改 SQL 阻止规则,允许对 sql/sqlHash/partition_num/tablet_num/cardinality/global/enable 等每一项进行修改。
该语句用于修改 SQL 阻止规则

语法:
## 语法

```sql
ALTER SQL_BLOCK_RULE rule_name
[PROPERTIES ("key"="value", ...)];
ALTER SQL_BLOCK_RULE <rule_name>
PROPERTIES (
-- property
<property>
-- Additional properties
[ , ... ]
)
```

说明:
## 必选参数

- sql 和 sqlHash 不能同时被设置。这意味着,如果一个 rule 设置了 sql 或者 sqlHash,则另一个属性将无法被修改;
- sql/sqlHash 和 partition_num/tablet_num/cardinality 不能同时被设置。举个例子,如果一个 rule 设置了 partition_num,那么 sql 或者 sqlHash 将无法被修改;
**<rule_name>**

## 示例
> 规则的名字
1. 根据 SQL 属性进行修改
**<property>**

```sql
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
```
具体见 CREATE SQL_BLOCK_RULE 的介绍

2. 如果一个 rule 设置了 partition_num,那么 sql 或者 sqlHash 将无法被修改
## 权限控制

```sql
ALTER SQL_BLOCK_RULE test_rule2 PROPERTIES("partition_num" = "10","tablet_num"="300","enable"="true")
```
执行此 SQL 命令的用户必须至少具有以下权限:

## 关键词
| 权限 | 对象 | 说明 |
| :---------------- | :------------- | :------------ |
| *ADMIN_PRIV* | 全局 | |

```text
ALTER,SQL_BLOCK_RULE
```
## 示例

### 最佳实践
1. 修改 sql 并开启规则

```sql
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
```
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,44 @@ under the License.

## Description

Modify SQL blocking rules to allow modification of each item such as sql/sqlHash/partition_num/tablet_num/cardinality/global/enable.
This statement is used to modify an SQL block rule.

## Syntax

grammar:

```sql
ALTER SQL_BLOCK_RULE rule_name
[PROPERTIES ("key"="value", ...)];
ALTER SQL_BLOCK_RULE <rule_name>
PROPERTIES (
-- property
<property>
-- Additional properties
[ , ... ]
)
```

illustrate:
## Required Parameters

- sql and sqlHash cannot be set at the same time. This means that if a rule sets sql or sqlHash, the other attribute cannot be modified;
- sql/sqlHash and partition_num/tablet_num/cardinality cannot be set at the same time. For example, if a rule sets partition_num, then sql or sqlHash cannot be modified;
**<rule_name>**

## Examples
> The name of the rule.
1. Modify according to SQL properties
**<property>**

```sql
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
```
See the introduction of [CREATE SQL_BLOCK_RULE](../data-governance/CREATE-SQL_BLOCK_RULE.md) for details.

2. If a rule sets partition_num, then sql or sqlHash cannot be modified
## Permissions

```sql
ALTER SQL_BLOCK_RULE test_rule2 PROPERTIES("partition_num" = "10","tablet_num"="300","enable"="true")
```
The user executing this SQL command must have at least the following permissions:

## Keywords
| Permission | Object | Description |
| ------------ | ------ | ----------- |
| *ADMIN_PRIV* | Global | |

## Example

1. Modify the SQL and enable the rule

```text
ALTER,SQL_BLOCK_RULE
```

## Best Practice
```sql
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
```
Loading

0 comments on commit eec1bad

Please sign in to comment.