| --- |
| { |
| "title": "ALTER-SQL-BLOCK-RULE", |
| "language": "en" |
| } |
| --- |
| |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| |
| ## ALTER-SQL-BLOCK-RULE |
| |
| ### Name |
| |
| ALTER SQL BLOCK RULE |
| |
| ### Description |
| |
| Modify SQL blocking rules to allow modification of each item such as sql/sqlHash/partition_num/tablet_num/cardinality/global/enable. |
| |
| grammar: |
| |
| ```sql |
| ALTER SQL_BLOCK_RULE rule_name |
| [PROPERTIES ("key"="value", ...)]; |
| ```` |
| |
| illustrate: |
| |
| - 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; |
| |
| ### Example |
| |
| 1. Modify according to SQL properties |
| |
| ```sql |
| ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true") |
| ```` |
| |
| 2. If a rule sets partition_num, then sql or sqlHash cannot be modified |
| |
| ```sql |
| ALTER SQL_BLOCK_RULE test_rule2 PROPERTIES("partition_num" = "10","tablet_num"="300","enable"="true") |
| ```` |
| |
| ### Keywords |
| |
| ````text |
| ALTER,SQL_BLOCK_RULE |
| ```` |
| |
| ### Best Practice |