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

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

commit d4b446d416e40d6978ec8a14b008442b181d5ea4
Author: starocean999 <40539150+starocean...@users.noreply.github.com>
AuthorDate: Sat Dec 24 20:07:14 2022 +0800

    [fix](fe)add session variable group_concat_max_len (#15254)
---
 docs/en/docs/advanced/variables.md                 |  3 +++
 docs/zh-CN/docs/advanced/variables.md              |  3 +++
 .../java/org/apache/doris/qe/SessionVariable.java  |  5 +++++
 .../test_show_dummy_variables.groovy               | 22 ++++++++++++++++++++++
 4 files changed, 33 insertions(+)

diff --git a/docs/en/docs/advanced/variables.md 
b/docs/en/docs/advanced/variables.md
index b61a175c87..be384315e5 100644
--- a/docs/en/docs/advanced/variables.md
+++ b/docs/en/docs/advanced/variables.md
@@ -553,3 +553,6 @@ Translated with www.DeepL.com/Translator (free version)
 * `validate_password_policy`
 
        Password strength verification policy. Defaults to `NONE` or `0`, i.e. 
no verification. Can be set to `STRONG` or `2`. When set to `STRONG` or `2`, 
when setting a password via the `ALTER USER` or `SET PASSWORD` commands, the 
password must contain any of "uppercase letters", "lowercase letters", 
"numbers" and "special characters". 3 items, and the length must be greater 
than or equal to 8. Special characters include: `~!@#$%^&*()_+|<>,.?/:;'[]{}"`.
+
+* `group_concat_max_len`
+    For compatible purpose. This variable has no effect, just enable some BI 
tools can query or set this session variable sucessfully.
\ No newline at end of file
diff --git a/docs/zh-CN/docs/advanced/variables.md 
b/docs/zh-CN/docs/advanced/variables.md
index 39cf63610e..2ca025f825 100644
--- a/docs/zh-CN/docs/advanced/variables.md
+++ b/docs/zh-CN/docs/advanced/variables.md
@@ -542,4 +542,7 @@ SELECT /*+ SET_VAR(query_timeout = 1, 
enable_partition_cache=true) */ sleep(3);
 * `validate_password_policy`
 
        密码强度校验策略。默认为 `NONE` 或 `0`,即不做校验。可以设置为 `STRONG` 或 `2`。当设置为 `STRONG` 或 
`2` 时,通过 `ALTER USER` 或 `SET PASSWORD` 
命令设置密码时,密码必须包含“大写字母”,“小写字母”,“数字”和“特殊字符”中的3项,并且长度必须大于等于8。特殊字符包括:`~!@#$%^&*()_+|<>,.?/:;'[]{}"`。
+
+* `group_concat_max_len`
+    为了兼容某些BI工具能正确获取和设置该变量,变量值实际并没有作用。
        
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index b7f30dc7c0..e2e82e91d9 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -244,6 +244,8 @@ public class SessionVariable implements Serializable, 
Writable {
     public static final String ENABLE_SHARE_HASH_TABLE_FOR_BROADCAST_JOIN
             = "enable_share_hash_table_for_broadcast_join";
 
+    public static final String GROUP_CONCAT_MAX_LEN = "group_concat_max_len";
+
     // session origin value
     public Map<Field, String> sessionOriginValue = new HashMap<Field, 
String>();
     // check stmt is or not [select /*+ SET_VAR(...)*/ ...]
@@ -641,6 +643,9 @@ public class SessionVariable implements Serializable, 
Writable {
     @VariableMgr.VarAttr(name = ENABLE_SHARE_HASH_TABLE_FOR_BROADCAST_JOIN)
     public boolean enableShareHashTableForBroadcastJoin = true;
 
+    @VariableMgr.VarAttr(name = GROUP_CONCAT_MAX_LEN)
+    public int groupConcatMaxLen = 2147483646;
+
     // If this fe is in fuzzy mode, then will use initFuzzyModeVariables to 
generate some variables,
     // not the default value set in the code.
     public void initFuzzyModeVariables() {
diff --git 
a/regression-test/suites/correctness_p0/test_show_dummy_variables.groovy 
b/regression-test/suites/correctness_p0/test_show_dummy_variables.groovy
new file mode 100644
index 0000000000..51f44fb07d
--- /dev/null
+++ b/regression-test/suites/correctness_p0/test_show_dummy_variables.groovy
@@ -0,0 +1,22 @@
+// 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.
+
+suite("test_show_dummy_variables") {
+
+    def ret = sql"""show variables like '%group_concat%';"""
+    assertTrue(ret.toString().contains("group_concat_max_len"))
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to