This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new d5aeb9a  Add document for session variables. (#2284)
d5aeb9a is described below

commit d5aeb9a6b7c382bf7c1991dd0dc7c055cf2278a2
Author: Mingyu Chen <[email protected]>
AuthorDate: Sun Nov 24 22:47:05 2019 +0800

    Add document for session variables. (#2284)
    
    Also make the variable effective in current session when setting it 
globally.
---
 be/src/runtime/tmp_file_mgr.cc                     |   1 -
 .../cn/administrator-guide/config/index.rst        |   9 +
 .../documentation/cn/administrator-guide/index.rst |   1 +
 .../cn/administrator-guide/session-variables.md    | 299 ++++++++++++++++++++
 docs/documentation/cn/developer-guide/index.rst    |   8 +
 docs/documentation/cn/index.rst                    |   1 +
 .../en/administrator-guide/config/index.rst        |   9 +
 .../documentation/en/administrator-guide/index.rst |   1 +
 .../en/administrator-guide/session-variables_EN.md | 300 +++++++++++++++++++++
 docs/documentation/en/developer-guide/index.rst    |   8 +
 docs/documentation/en/index.rst                    |   1 +
 .../org/apache/doris/analysis/ShowBrokerStmt.java  |   9 +
 .../apache/doris/analysis/ShowFrontendsStmt.java   |   9 +
 .../org/apache/doris/planner/PlanFragment.java     |   8 +-
 .../main/java/org/apache/doris/qe/Coordinator.java |   2 +-
 .../java/org/apache/doris/qe/GlobalVariable.java   |   2 +-
 .../java/org/apache/doris/qe/SessionVariable.java  |   5 -
 .../main/java/org/apache/doris/qe/VariableMgr.java |   6 +-
 .../java/org/apache/doris/qe/VariableMgrTest.java  |   6 +-
 19 files changed, 667 insertions(+), 18 deletions(-)

diff --git a/be/src/runtime/tmp_file_mgr.cc b/be/src/runtime/tmp_file_mgr.cc
index 14d881e..87ed68b 100644
--- a/be/src/runtime/tmp_file_mgr.cc
+++ b/be/src/runtime/tmp_file_mgr.cc
@@ -59,7 +59,6 @@ TmpFileMgr::TmpFileMgr(ExecEnv* exec_env) :
         // _num_active_scratch_dirs_metric(NULL), 
_active_scratch_dirs_metric(NULL) {}
 
 Status TmpFileMgr::init(MetricRegistry* metrics) {
-    std::string tmp_dirs_spec = config::storage_root_path;
     vector<string> all_tmp_dirs;
     for (auto& path : _exec_env->store_paths()) {
         all_tmp_dirs.emplace_back(path.path);
diff --git a/docs/documentation/cn/administrator-guide/config/index.rst 
b/docs/documentation/cn/administrator-guide/config/index.rst
new file mode 100644
index 0000000..15374d5
--- /dev/null
+++ b/docs/documentation/cn/administrator-guide/config/index.rst
@@ -0,0 +1,9 @@
+=============
+配置文件
+=============
+
+.. toctree::
+    :maxdepth: 1
+    :glob:
+
+    *
diff --git a/docs/documentation/cn/administrator-guide/index.rst 
b/docs/documentation/cn/administrator-guide/index.rst
index e8d5d5f..31e06b6 100644
--- a/docs/documentation/cn/administrator-guide/index.rst
+++ b/docs/documentation/cn/administrator-guide/index.rst
@@ -9,6 +9,7 @@
     alter-table/index
     http-actions/index
     operation/index
+    config/index
 
 .. toctree::
     :maxdepth: 1
diff --git a/docs/documentation/cn/administrator-guide/session-variables.md 
b/docs/documentation/cn/administrator-guide/session-variables.md
new file mode 100644
index 0000000..73a1d70
--- /dev/null
+++ b/docs/documentation/cn/administrator-guide/session-variables.md
@@ -0,0 +1,299 @@
+<!-- 
+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.
+-->
+
+# 变量
+
+本文档主要介绍当前支持的变量(variables)。
+
+Doris 中的变量参考 MySQL 中的变量设置。但部分变量仅用于兼容一些 MySQL 客户端协议,并不产生其在 MySQL 数据库中的实际意义。
+
+## 变量设置与查看
+
+### 查看
+
+可以通过 `SHOW VARIABLES [LIKE 'xxx'];` 查看所有或指定的变量。如:
+
+```
+SHOW VARIABLES;
+SHOW VARIABLES LIKE '%time_zone%';
+```
+
+### 设置
+
+部分变量可以设置全局生效或仅当前会话生效。设置全局生效后,后续新的会话连接中会沿用设置值。而设置仅当前会话生效,则变量仅对当前会话产生作用。
+
+仅当前会话生效,通过 `SET var_name=xxx;` 语句来设置。如:
+
+```
+SET exec_mem_limit = 137438953472;
+SET forward_to_master = true;
+SET time_zone = "Asia/Shanghai";
+```
+
+全局生效,通过 `SET GLOBALE var_name=xxx;` 设置。如:
+
+```
+SET GLOBAL exec_mem_limit = 137438953472
+```
+
+同时,变量设置也支持常量表达式。如:
+
+```
+SET exec_mem_limit = 10 * 1024 * 1024 * 1024;
+SET forward_to_master = concat('tr', 'u', 'e');
+```
+
+> 注1:只有 ADMIN 用户可以设置变量的全局生效。
+
+支持全局生效的变量包括:
+
+* `time_zone`
+* `wait_timeout`
+* `sql_mode`
+* `is_report_success`
+* `query_timeout`
+* `exec_mem_limit`
+* `batch_size`
+* `parallel_fragment_exec_instance_num`
+* `parallel_fragment_exec_instance_num`
+
+## 支持的变量
+
+* `SQL_AUTO_IS_NULL`
+
+    用于兼容 JDBC 连接池 C3P0。 无实际作用。
+    
+* `auto_increment_increment`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `autocommit`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `batch_size`
+
+    用于指定在查询执行过程中,各个节点传输的单个数据包的行数。默认一个数据包的行数为 1024 行,即源端节点每产生 1024 
行数据后,打包发给目的节点。
+    
+    较大的行数,会在扫描大数据量场景下提升查询的吞吐,但在可能会在小查询场景下增加查询延迟。同时,也会增加查询的内存开销。建议设置范围 1024 至 
4096。
+    
+* `character_set_client`
+
+     用于兼容 MySQL 客户端。无实际作用。
+
+* `character_set_connection`
+
+    用于兼容 MySQL 客户端。无实际作用。
+
+* `character_set_results`
+
+    用于兼容 MySQL 客户端。无实际作用。
+
+* `character_set_server`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `codegen_level`
+
+    用于设置 LLVM codegen 的等级。(当前未生效)。
+    
+* `collation_connection`
+
+    用于兼容 MySQL 客户端。无实际作用。
+
+* `collation_database`
+
+    用于兼容 MySQL 客户端。无实际作用。
+
+* `collation_server`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `disable_colocate_join`
+
+    控制是否启用 [Colocation Join](./colocation-join.md) 功能。默认为 false,表示启用该功能。true 
表示禁用该功能。当该功能被禁用后,查询规划将不会尝试执行 Colocation Join。
+    
+* `disable_streaming_preaggregations`
+
+    控制是否开启流式预聚合。默认为 false,即开启。当前不可设置,且默认开启。
+    
+* `enable_insert_strict`
+
+    用于设置通过 INSERT 语句进行数据导入时,是否开启 `strict` 模式。默认为 false,即不开启 `strict` 
模式。关于该模式的介绍,可以参阅 [这里](./load-data/insert-into-manual.md)。
+
+* `enable_spilling`
+
+    用于设置是否开启大数据量落盘排序。默认为 false,即关闭该功能。当用户未指定 ORDER BY 子句的 LIMIT 条件,同时设置 
`enable_spilling` 为 true 时,才会开启落盘排序。该功能启用后,会使用 BE 数据目录下 `doris-scratch/` 
目录存放临时的落盘数据,并在查询结束后,清空临时数据。
+    
+    该功能主要用于使用有限的内存进行大数据量的排序操作。
+    
+    注意,该功能为实验性质,不保证稳定性,请谨慎开启。
+    
+* `exec_mem_limit`
+
+    用于设置单个查询的内存限制。默认为 2GB,单位为字节。
+    
+    该参数用于限制一个查询计划中,单个查询计划的实例所能使用的内存。一个查询计划可能有多个实例,一个 BE 
节点可能执行一个或多个实例。所以该参数并不能准确限制一个查询在整个集群的内存使用,也不能准确限制一个查询在单一 BE 
节点上的内存使用。具体需要根据生成的查询计划判断。
+    
+    通常只有在一些阻塞节点(如排序节点、聚合节点、Join 节点)上才会消耗较多的内存,而其他节点(如扫描节点)中,数据为流式通过,并不会占用较多的内存。
+    
+    当出现 `Memory Exceed Limit` 错误时,可以尝试指数级增加该参数,如 4G、8G、16G 等。
+    
+* `forward_to_master`
+
+    用户设置是否将一些命令转发到 Master FE 节点执行。默认为 false,即不转发。Doris 中存在多个 FE 节点,其中一个为 
Master 节点。通常用户可以连接任意 FE 节点进行全功能操作。但部分信息查看指令,只有从 Master FE 节点才能获取详细信息。
+    
+    如 `SHOW BACKENDS;` 命令,如果不转发到 Master FE 节点,则仅能看到节点是否存活等一些基本信息,而转发到 Master 
FE 则可以获取包括节点启动时间、最后一次心跳时间等更详细的信息。
+    
+    当前受该参数影响的命令如下:
+    
+    1. `SHOW FRONTEND;`
+
+        转发到 Master 可以查看最后一次心跳信息。
+    
+    2. `SHOW BACKENDS;`
+
+        转发到 Master 可以查看启动时间、最后一次心跳信息、磁盘容量信息。
+        
+    3. `SHOW BROKERS;`
+
+        转发到 Master 可以查看启动时间、最后一次心跳信息。
+        
+    4. `SHOW TABLET;`/`ADMIN SHOW REPLICA DISTRIBUTION;`/`ADMIN SHOW REPLICA 
STATUS;`
+
+        转发到 Master 可以查看 Master FE 元数据中存储的 tablet 信息。正常情况下,不同 FE 元数据中 tablet 
信息应该是一致的。当出现问题时,可以通过这个方法比较当前 FE 和 Master FE 元数据的差异。
+        
+    5. `SHOW PROC;`
+
+        转发到 Master 可以查看 Master FE 元数据中存储的相关 PROC 的信息。主要用于元数据比对。
+        
+* `init_connect`
+   
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `interactive_timeout`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `is_report_success`
+
+    用于设置是否需要查看查询的 profile。默认为 false,即不需要 profile。
+    
+    默认情况下,只有在查询发生错误时,BE 才会发送 profile 给 FE,用于查看错误。正常结束的查询不会发送 profile。发送 
profile 会产生一定的网络开销,对高并发查询场景不利。
+    当用户希望对一个查询的 profile 进行分析时,可以将这个变量设为 true 后,发送查询。查询结束后,可以通过在当前连接的 FE 的 web 
页面查看到 profile:
+    
+    `fe_host:fe_http:port/query`
+    
+    其中会显示最近100条,开启 `is_report_success` 的查询的 profile。
+    
+* `language`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `license`
+    
+    显示 Doris 的 License。无其他作用。
+    
+* `lower_case_table_names`
+
+    用于兼容 MySQL 客户端。不可设置。当前 Doris 中的表名默认为大小写敏感。
+    
+* `max_allowed_packet`
+
+    用于兼容 JDBC 连接池 C3P0。 无实际作用。
+    
+* `net_buffer_length`
+
+    用于兼容 MySQL 客户端。无实际作用。
+
+* `net_read_timeout`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `net_write_timeout`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `parallel_exchange_instance_num`
+
+    用于设置执行计划中,一个上层节点接收下层节点数据所使用的 exchange node 数量。默认为 -1,即表示 exchange node 
数量等于下层节点执行实例的个数(默认行为)。当设置大于0,并且小于下层节点执行实例的个数,则 exchange node 数量等于设置值。
+    
+    在一个分布式的查询执行计划中,上层节点通常有一个或多个 exchange node 用于接收来自下层节点在不同 BE 上的执行实例的数据。通常 
exchange node 数量等于下层节点执行实例数量。
+    
+    如果用户需要减少上层节点的 exchange node 数量,可以设置该值。
+    
+* `parallel_fragment_exec_instance_num`
+
+    针对扫描节点,设置其在每个 BE 节点上,执行实例的个数。默认为 1。
+    
+    一个查询计划通常会产生一组 scan range,即需要扫描的数据范围。这些数据分布在多个 BE 节点上。一个 BE 节点会有一个或多个 scan 
range。默认情况下,每个 BE 节点的一组 scan range 
只由一个执行实例处理。当机器资源比较充裕时,可以将增加该变量,让更多的执行实例同时处理一组 scan range,从而提升查询效率。
+    
+    修改该参数仅对扫描节点的效率提升有帮助。较大数值可能会消耗更多的机器资源,如CPU、内存、磁盘IO。
+    
+* `query_cache_size`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `query_cache_type`
+
+    用于兼容 JDBC 连接池 C3P0。 无实际作用。
+    
+* `query_timeout`
+
+    用于设置查询超时。该变量会作用于当前连接中所有的查询语句,以及 INSERT 语句。默认为 5 分钟,单位为秒。
+
+* `resource_group`
+
+    暂不使用。
+    
+* `sql_mode`
+
+    用于指定 SQL 模式,以适应某些 SQL 方言。关于 SQL 模式,可参阅 [这里](./sql-mode.md)。
+    
+* `sql_safe_updates`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `sql_select_limit`
+
+    用于兼容 MySQL 客户端。无实际作用。
+
+* `system_time_zone`
+
+    显示当前系统时区。不可更改。
+    
+* `time_zone`
+
+    用于设置当前会话的时区。时区会对某些时间函数的结果产生影响。关于时区,可以参阅 [这里](./time-zone.md)。
+    
+* `tx_isolation`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `version`
+
+    用于兼容 MySQL 客户端。无实际作用。
+    
+* `version_comment`
+
+    用于显示 Doris 的版本。不可更改。
+    
+* `wait_timeout`
+
+    用于设置空闲连接的连接时长。当一个空闲连接在该时长内与 Doris 没有任何交互,则 Doris 会主动断开这个链接。默认为 8 小时,单位为秒。
diff --git a/docs/documentation/cn/developer-guide/index.rst 
b/docs/documentation/cn/developer-guide/index.rst
new file mode 100644
index 0000000..ba6bb38
--- /dev/null
+++ b/docs/documentation/cn/developer-guide/index.rst
@@ -0,0 +1,8 @@
+=============
+开发者手册
+=============
+
+.. toctree::
+    :glob:
+    
+    *
diff --git a/docs/documentation/cn/index.rst b/docs/documentation/cn/index.rst
index 7fb36a9..4c9ed98 100644
--- a/docs/documentation/cn/index.rst
+++ b/docs/documentation/cn/index.rst
@@ -13,5 +13,6 @@
     extending-doris/index
     internal/index
     sql-reference/index
+    developer-guide/index    
     community/index
 
diff --git a/docs/documentation/en/administrator-guide/config/index.rst 
b/docs/documentation/en/administrator-guide/config/index.rst
new file mode 100644
index 0000000..9681f60
--- /dev/null
+++ b/docs/documentation/en/administrator-guide/config/index.rst
@@ -0,0 +1,9 @@
+==============
+Configuration
+==============
+
+.. toctree::
+    :maxdepth: 1
+    :glob:
+
+    *
diff --git a/docs/documentation/en/administrator-guide/index.rst 
b/docs/documentation/en/administrator-guide/index.rst
index 1675042..a1237db 100644
--- a/docs/documentation/en/administrator-guide/index.rst
+++ b/docs/documentation/en/administrator-guide/index.rst
@@ -8,6 +8,7 @@ Administrator Guide
     load-data/index
     http-actions/index
     operation/index
+    config/index
 
 .. toctree::
     :maxdepth: 1
diff --git a/docs/documentation/en/administrator-guide/session-variables_EN.md 
b/docs/documentation/en/administrator-guide/session-variables_EN.md
new file mode 100644
index 0000000..46f754f
--- /dev/null
+++ b/docs/documentation/en/administrator-guide/session-variables_EN.md
@@ -0,0 +1,300 @@
+<!-- 
+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.
+-->
+
+# Variable
+
+This document focuses on currently supported variables.
+
+Variables in Doris refer to variable settings in MySQL. However, some of the 
variables are only used to be compatible with some MySQL client protocols, and 
do not produce their actual meaning in the MySQL database.
+
+## Variable setting and viewing
+
+### View
+
+All or specified variables can be viewed via `SHOW VARIABLES [LIKE 'xxx'];`. 
Such as:
+
+```
+SHOW VARIABLES;
+SHOW VARIABLES LIKE '%time_zone%';
+```
+
+### Settings
+
+Some variables can be set at global-level or session-only. For global-level, 
the set value will be used in subsequent new session connections. For 
session-only, the variable only works for the current session.
+
+For session-only, set by the `SET var_name=xxx;` statement. Such as:
+
+```
+SET exec_mem_limit = 137438953472;
+SET forward_to_master = true;
+SET time_zone = "Asia/Shanghai";
+```
+
+For global-level, set by `SET GLOBALE var_name=xxx;`. Such as:
+
+```
+SET GLOBAL exec_mem_limit = 137438953472
+```
+
+At the same time, variable settings also support constant expressions. Such as:
+
+```
+SET exec_mem_limit = 10 * 1024 * 1024 * 1024;
+SET forward_to_master = concat('tr', 'u', 'e');
+```
+
+> Note 1: Only ADMIN users can set variable at global-level.
+
+Variables that support global-level setting include:
+
+* `time_zone`
+* `wait_timeout`
+* `sql_mode`
+* `is_report_success`
+* `query_timeout`
+* `exec_mem_limit`
+* `batch_size`
+* `parallel_fragment_exec_instance_num`
+* `parallel_fragment_exec_instance_num`
+
+## Supported variables
+
+* `SQL_AUTO_IS_NULL`
+
+    Used for compatible JDBC connection pool C3P0. No practical effect.
+    
+* `auto_increment_increment`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `autocommit`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `batch_size`
+
+    Used to specify the number of rows of a single packet transmitted by each 
node during query execution. By default, the number of rows of a packet is 1024 
rows. That is, after the source node generates 1024 rows of data, it is 
packaged and sent to the destination node.
+    
+    A larger number of rows will increase the throughput of the query in the 
case of scanning large data volumes, but may increase the query delay in small 
query scenario. At the same time, it also increases the memory overhead of the 
query. The recommended setting range is 1024 to 4096.
+    
+* `character_set_client`
+
+     Used for compatibility with MySQL clients. No practical effect.
+
+* `character_set_connection`
+
+    Used for compatibility with MySQL clients. No practical effect.
+
+* `character_set_results`
+
+    Used for compatibility with MySQL clients. No practical effect.
+
+* `character_set_server`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `codegen_level`
+
+    Used to set the level of LLVM codegen. (Not currently in effect).
+    
+* `collation_connection`
+
+    Used for compatibility with MySQL clients. No practical effect.
+
+* `collation_database`
+
+    Used for compatibility with MySQL clients. No practical effect.
+
+* `collation_server`
+
+    Used for compatibility with MySQL clients. No practical effect.
+
+* `disable_colocate_join`
+
+    Controls whether the [Colocation Join] (./colocation-join.md) function is 
enabled. The default is false, which means that the feature is enabled. True 
means that the feature is disabled. When this feature is disabled, the query 
plan will not attempt to perform a Colocation Join.
+    
+* `disable_streaming_preaggregations`
+
+    Controls whether streaming pre-aggregation is turned on. The default is 
false, which is enabled. Currently not configurable and enabled by default.
+    
+* `enable_insert_strict`
+
+    Used to set the `strict` mode when loadingdata via INSERT statement. The 
default is false, which means that the `strict` mode is not turned on. For an 
introduction to this mode, see [here] (./load-data/insert-into-manual.md).
+
+* `enable_spilling`
+
+    Used to set whether to enable external sorting. The default is false, 
which turns off the feature. This feature is enabled when the user does not 
specify a LIMIT condition for the ORDER BY clause and also sets 
`enable_spilling` to true. When this feature is enabled, the temporary data is 
stored in the `doris-scratch/` directory of the BE data directory and the 
temporary data is cleared after the query is completed.
+    
+    This feature is mainly used for sorting operations with large amounts of 
data using limited memory.
+    
+    Note that this feature is experimental and does not guarantee stability. 
Please turn it on carefully.
+    
+* `exec_mem_limit`
+
+    Used to set the memory limit for a single query. The default is 2GB, in 
bytes.
+    
+    This parameter is used to limit the memory that can be used by an instance 
of a single query fragment in a query plan. A query plan may have multiple 
instances, and a BE node may execute one or more instances. Therefore, this 
parameter does not accurately limit the memory usage of a query across the 
cluster, nor does it accurately limit the memory usage of a query on a single 
BE node. The specific needs need to be judged according to the generated query 
plan.
+    
+    Usually, only some blocking nodes (such as sorting node, aggregation node, 
and join node) consume more memory, while in other nodes (such as scan node), 
data is streamed and does not occupy much memory.
+    
+    When a `Memory Exceed Limit` error occurs, you can try to increase the 
parameter exponentially, such as 4G, 8G, 16G, and so on.
+    
+* `forward_to_master`
+
+    The user sets whether to forward some commands to the Master FE node for 
execution. The default is false, which means no forwarding. There are multiple 
FE nodes in Doris, one of which is the Master node. Usually users can connect 
to any FE node for full-featured operation. However, some of detail 
informationcan only be obtained from the Master FE node.
+    
+    For example, the `SHOW BACKENDS;` command, if not forwarded to the Master 
FE node, can only see some basic information such as whether the node is alive, 
and forwarded to the Master FE to obtain more detailed information including 
the node startup time and the last heartbeat time.
+    
+    The commands currently affected by this parameter are as follows:
+    
+    1. `SHOW FRONTEND;`
+
+        Forward to Master to view the last heartbeat information.
+    
+    2. `SHOW BACKENDS;`
+
+        Forward to Master to view startup time, last heartbeat information, 
and disk capacity information.
+        
+    3. `SHOW BROKERS;`
+
+        Forward to Master to view the start time and last heartbeat 
information.
+        
+    4. `SHOW TABLET;`/`ADMIN SHOW REPLICA DISTRIBUTION;`/`ADMIN SHOW REPLICA 
STATUS;`
+
+        Forward to Master to view the tablet information stored in the Master 
FE metadata. Under normal circumstances, the tablet information in different FE 
metadata should be consistent. When a problem occurs, this method can be used 
to compare the difference between the current FE and Master FE metadata.
+        
+    5. `SHOW PROC;`
+
+        Forward to Master to view information about the relevant PROC stored 
in the Master FE metadata. Mainly used for metadata comparison.
+        
+* `init_connect`
+   
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `interactive_timeout`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `is_report_success`
+
+    Used to set whether you need to view the profile of the query. The default 
is false, which means no profile is required.
+    
+    By default, the BE sends a profile to the FE for viewing errors only if an 
error occurs in the query. A successful query will not send a profile. Sending 
a profile will incur a certain amount of network overhead, which is detrimental 
to a high concurrent query scenario.
+    
+    When the user wants to analyze the profile of a query, the query can be 
sent after this variable is set to true. After the query is finished, you can 
view the profile on the web page of the currently connected FE:
+    
+    `fe_host:fe_http:port/query`
+    
+    It will display the most recent 100 queries which `is_report_success` is 
set to true.
+    
+* `language`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `license`
+    
+    Show Doris's license. No other effect.
+    
+* `lower_case_table_names`
+
+    Used for compatibility with MySQL clients. Cannot be set. Table names in 
current Doris are case sensitive by default.
+    
+* `max_allowed_packet`
+
+    Used for compatible JDBC connection pool C3P0. No practical effect.
+    
+* `net_buffer_length`
+
+    Used for compatibility with MySQL clients. No practical effect.
+
+* `net_read_timeout`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `net_write_timeout`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `parallel_exchange_instance_num`
+
+    Used to set the number of exchange nodes used by an upper node to receive 
data from the lower node in the execution plan. The default is -1, which means 
that the number of exchange nodes is equal to the number of execution instances 
of the lower nodes (default behavior). When the setting is greater than 0 and 
less than the number of execution instances of the lower node, the number of 
exchange nodes is equal to the set value.
+    
+    In a distributed query execution plan, the upper node usually has one or 
more exchange nodes for receiving data from the execution instances of the 
lower nodes on different BEs. Usually the number of exchange nodes is equal to 
the number of execution instances of the lower nodes.
+    
+    This value can be set if the user needs to reduce the number of exchange 
nodes of the upper node.
+
+* `parallel_fragment_exec_instance_num`
+
+    For the scan node, set its number of instances to execute on each BE node. 
The default is 1.
+    
+    A query plan typically produces a set of scan ranges, the range of data 
that needs to be scanned. These data are distributed across multiple BE nodes. 
A BE node will have one or more scan ranges. By default, a set of scan ranges 
for each BE node is processed by only one execution instance. When the machine 
resources are abundant, you can increase the variable and let more execution 
instances process a set of scan ranges at the same time, thus improving query 
efficiency.
+    
+    Modifying this parameter is only helpful for improving the efficiency of 
the scan node. Larger values ​​may consume more machine resources such as CPU, 
memory, and disk IO.
+    
+* `query_cache_size`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `query_cache_type`
+
+    Used for compatible JDBC connection pool C3P0. No practical effect.
+    
+* `query_timeout`
+
+    Used to set the query timeout. This variable applies to all query 
statements in the current connection, as well as INSERT statements. The default 
is 5 minutes, in seconds.
+
+* `resource_group`
+
+    Not used.
+    
+* `sql_mode`
+
+    Used to specify SQL mode to accommodate certain SQL dialects. For the SQL 
mode, see [here] (./sql-mode.md).
+    
+* `sql_safe_updates`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `sql_select_limit`
+
+    Used for compatibility with MySQL clients. No practical effect.
+
+* `system_time_zone`
+
+    Displays the current system time zone. Cannot be changed.
+    
+* `time_zone`
+
+    Used to set the time zone of the current session. The time zone has an 
effect on the results of certain time functions. For the time zone, see [here] 
(./time-zone.md).
+    
+* `tx_isolation`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `version`
+
+    Used for compatibility with MySQL clients. No practical effect.
+    
+* `version_comment`
+
+    Used to display the version of Doris. Cannot be changed.
+    
+* `wait_timeout`
+
+    The length of the connection used to set up an idle connection. When an 
idle connection does not interact with Doris for that length of time, Doris 
will actively disconnect the link. The default is 8 hours, in seconds.
diff --git a/docs/documentation/en/developer-guide/index.rst 
b/docs/documentation/en/developer-guide/index.rst
new file mode 100644
index 0000000..1eb091a
--- /dev/null
+++ b/docs/documentation/en/developer-guide/index.rst
@@ -0,0 +1,8 @@
+================
+Developer Guide
+================
+
+.. toctree::
+    :glob:
+    
+    *
diff --git a/docs/documentation/en/index.rst b/docs/documentation/en/index.rst
index 41a73f4..1167661 100644
--- a/docs/documentation/en/index.rst
+++ b/docs/documentation/en/index.rst
@@ -14,5 +14,6 @@ You can simply click "Edit on Github" at right top of a page, 
and edit the docum
     extending-doris/index
     internal/index
     sql-reference/index
+    developer-guide/index
     community/index
 
diff --git a/fe/src/main/java/org/apache/doris/analysis/ShowBrokerStmt.java 
b/fe/src/main/java/org/apache/doris/analysis/ShowBrokerStmt.java
index bff9191..065a360 100644
--- a/fe/src/main/java/org/apache/doris/analysis/ShowBrokerStmt.java
+++ b/fe/src/main/java/org/apache/doris/analysis/ShowBrokerStmt.java
@@ -49,4 +49,13 @@ public class ShowBrokerStmt extends ShowStmt {
         }
         return builder.build();
     }
+
+    @Override
+    public RedirectStatus getRedirectStatus() {
+        if (ConnectContext.get().getSessionVariable().getForwardToMaster()) {
+            return RedirectStatus.FORWARD_NO_SYNC;
+        } else {
+            return RedirectStatus.NO_FORWARD;
+        }
+    }
 }
diff --git a/fe/src/main/java/org/apache/doris/analysis/ShowFrontendsStmt.java 
b/fe/src/main/java/org/apache/doris/analysis/ShowFrontendsStmt.java
index 38af38d..779d793 100644
--- a/fe/src/main/java/org/apache/doris/analysis/ShowFrontendsStmt.java
+++ b/fe/src/main/java/org/apache/doris/analysis/ShowFrontendsStmt.java
@@ -54,5 +54,14 @@ public class ShowFrontendsStmt extends ShowStmt {
         }
         return builder.build();
     }
+
+    @Override
+    public RedirectStatus getRedirectStatus() {
+        if (ConnectContext.get().getSessionVariable().getForwardToMaster()) {
+            return RedirectStatus.FORWARD_NO_SYNC;
+        } else {
+            return RedirectStatus.NO_FORWARD;
+        }
+    }
 }
 
diff --git a/fe/src/main/java/org/apache/doris/planner/PlanFragment.java 
b/fe/src/main/java/org/apache/doris/planner/PlanFragment.java
index aa22078..77a5259 100644
--- a/fe/src/main/java/org/apache/doris/planner/PlanFragment.java
+++ b/fe/src/main/java/org/apache/doris/planner/PlanFragment.java
@@ -108,7 +108,7 @@ public class PlanFragment extends TreeNode<PlanFragment> {
 
     // specification of the number of parallel when fragment is executed
     // default value is 1
-    private int parallel_exec_num = 1;
+    private int parallelExecNum = 1;
 
     /**
      * C'tor for fragment with specific partition; the output is by default 
broadcast.
@@ -141,7 +141,7 @@ public class PlanFragment extends TreeNode<PlanFragment> {
      */
     public void setParallelExecNumIfExists() {
         if (ConnectContext.get() != null) {
-            parallel_exec_num = 
ConnectContext.get().getSessionVariable().getParallelExecInstanceNum();
+            parallelExecNum = 
ConnectContext.get().getSessionVariable().getParallelExecInstanceNum();
         }
     }
 
@@ -186,8 +186,8 @@ public class PlanFragment extends TreeNode<PlanFragment> {
         return dataPartition == DataPartition.UNPARTITIONED ? 1 : 
planRoot.getNumNodes();
     }
 
-    public int getParallel_exec_num() {
-        return parallel_exec_num;
+    public int getParallelExecNum() {
+        return parallelExecNum;
     }
 
     public TPlanFragment toThrift() {
diff --git a/fe/src/main/java/org/apache/doris/qe/Coordinator.java 
b/fe/src/main/java/org/apache/doris/qe/Coordinator.java
index f315f26..5cf4ea4 100644
--- a/fe/src/main/java/org/apache/doris/qe/Coordinator.java
+++ b/fe/src/main/java/org/apache/doris/qe/Coordinator.java
@@ -897,7 +897,7 @@ public class Coordinator {
             } else {
                 // case A
                 Iterator iter = 
fragmentExecParamsMap.get(fragment.getFragmentId()).scanRangeAssignment.entrySet().iterator();
-                int parallelExecInstanceNum = fragment.getParallel_exec_num();
+                int parallelExecInstanceNum = fragment.getParallelExecNum();
                 while (iter.hasNext()) {
                     Map.Entry entry = (Map.Entry) iter.next();
                     TNetworkAddress key = (TNetworkAddress) entry.getKey();
diff --git a/fe/src/main/java/org/apache/doris/qe/GlobalVariable.java 
b/fe/src/main/java/org/apache/doris/qe/GlobalVariable.java
index 70105ae..6d41030 100644
--- a/fe/src/main/java/org/apache/doris/qe/GlobalVariable.java
+++ b/fe/src/main/java/org/apache/doris/qe/GlobalVariable.java
@@ -39,7 +39,7 @@ public final class GlobalVariable {
     public static int lowerCaseTableNames = 0;
 
     @VariableMgr.VarAttr(name = "license", flag = VariableMgr.READ_ONLY)
-    public static String license = "Baidu";
+    public static String license = "Apache License, Version 2.0";
 
     @VariableMgr.VarAttr(name = "language", flag = VariableMgr.READ_ONLY)
     public static String language = "/palo/share/english/";
diff --git a/fe/src/main/java/org/apache/doris/qe/SessionVariable.java 
b/fe/src/main/java/org/apache/doris/qe/SessionVariable.java
index 383f529..4b0833d 100644
--- a/fe/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -164,7 +164,6 @@ public class SessionVariable implements Serializable, 
Writable {
     @VariableMgr.VarAttr(name = PARALLEL_EXCHANGE_INSTANCE_NUM)
     private int exchangeInstanceParallel = -1;
 
-    // The current time zone
     @VariableMgr.VarAttr(name = SQL_SAFE_UPDATES)
     private int sqlSafeUpdates = 0;
 
@@ -342,10 +341,6 @@ public class SessionVariable implements Serializable, 
Writable {
         this.interactiveTimeout = interactiveTimeout;
     }
 
-    public int getWaitTimeout() {
-        return waitTimeout;
-    }
-
     public void setWaitTimeout(int waitTimeout) {
         this.waitTimeout = waitTimeout;
     }
diff --git a/fe/src/main/java/org/apache/doris/qe/VariableMgr.java 
b/fe/src/main/java/org/apache/doris/qe/VariableMgr.java
index 5af58ae..81ba0ef 100644
--- a/fe/src/main/java/org/apache/doris/qe/VariableMgr.java
+++ b/fe/src/main/java/org/apache/doris/qe/VariableMgr.java
@@ -239,10 +239,10 @@ public class VariableMgr {
                 wlock.unlock();
             }
             writeGlobalVariableUpdate(globalSessionVariable, "update global 
variables");
-        } else {
-            // Only session
-            setValue(sessionVariable, ctx.getField(), value);
         }
+
+        // whether it is session or global, set variables in current session, 
to make it effective.
+        setValue(sessionVariable, ctx.getField(), value);
     }
 
     // global variable persisitence
diff --git a/fe/src/test/java/org/apache/doris/qe/VariableMgrTest.java 
b/fe/src/test/java/org/apache/doris/qe/VariableMgrTest.java
index 2ee5ee8..9ac223d 100644
--- a/fe/src/test/java/org/apache/doris/qe/VariableMgrTest.java
+++ b/fe/src/test/java/org/apache/doris/qe/VariableMgrTest.java
@@ -90,19 +90,19 @@ public class VariableMgrTest {
         // Set global variable
         SetVar setVar = new SetVar(SetType.GLOBAL, "exec_mem_limit", new 
IntLiteral(1234L));
         VariableMgr.setVar(var, setVar);
-        Assert.assertEquals(2147483648L, var.getMaxExecMemByte());
+        Assert.assertEquals(1234L, var.getMaxExecMemByte());
         var = VariableMgr.newSessionVariable();
         Assert.assertEquals(1234L, var.getMaxExecMemByte());
 
         SetVar setVar2 = new SetVar(SetType.GLOBAL, 
"parallel_fragment_exec_instance_num", new IntLiteral(5L));
         VariableMgr.setVar(var, setVar2);
-        Assert.assertEquals(1L, var.getParallelExecInstanceNum());
+        Assert.assertEquals(5L, var.getParallelExecInstanceNum());
         var = VariableMgr.newSessionVariable();
         Assert.assertEquals(5L, var.getParallelExecInstanceNum());
 
         SetVar setVar3 = new SetVar(SetType.GLOBAL, "time_zone", new 
StringLiteral("Asia/Shanghai"));
         VariableMgr.setVar(var, setVar3);
-        Assert.assertEquals("CST", var.getTimeZone());
+        Assert.assertEquals("Asia/Shanghai", var.getTimeZone());
         var = VariableMgr.newSessionVariable();
         Assert.assertEquals("Asia/Shanghai", var.getTimeZone());
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to