You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by da...@apache.org on 2022/12/24 12:07:25 UTC
[doris] branch master updated: [fix](fe)add session variable group_concat_max_len (#15254)
This is an automated email from the ASF dual-hosted git repository.
dataroaring 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 fd764b3ccd [fix](fe)add session variable group_concat_max_len (#15254)
fd764b3ccd is described below
commit fd764b3ccde00ad83c3fd9988186356e7f4079f8
Author: starocean999 <40...@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 0e3141c7f9..68877f71e2 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
@@ -252,6 +252,8 @@ public class SessionVariable implements Serializable, Writable {
public static final String REPEAT_MAX_NUM = "repeat_max_num";
+ 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(...)*/ ...]
@@ -648,6 +650,9 @@ public class SessionVariable implements Serializable, Writable {
@VariableMgr.VarAttr(name = REPEAT_MAX_NUM)
public int repeatMaxNum = 10000;
+ @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-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org