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

lijibing pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 37583d2d0a0 [test](statistics)Add test case for set global variables. 
(#37582) (#37691)
37583d2d0a0 is described below

commit 37583d2d0a06b8bb5df045179df3fd6e4f7b0eed
Author: Jibing-Li <64681310+jibing...@users.noreply.github.com>
AuthorDate: Fri Jul 12 13:46:53 2024 +0800

    [test](statistics)Add test case for set global variables. (#37582) (#37691)
    
    backport: https://github.com/apache/doris/pull/37582
---
 .../test_statistic_global_variable.groovy          | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git 
a/regression-test/suites/statistics/test_statistic_global_variable.groovy 
b/regression-test/suites/statistics/test_statistic_global_variable.groovy
new file mode 100644
index 00000000000..0c96f450bff
--- /dev/null
+++ b/regression-test/suites/statistics/test_statistic_global_variable.groovy
@@ -0,0 +1,62 @@
+// 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_statistic_global_variable", "p0, nonConcurrent") {
+
+    def verifyVairable = { variable, value ->
+        sql """set global ${variable}="${value}";"""
+        def result = sql """show variables like "${variable}"; """
+        logger.info("result " + result)
+        assertEquals(value, result[0][1])
+    }
+
+    try {
+        verifyVairable("enable_auto_analyze", "true")
+        verifyVairable("enable_auto_analyze", "false")
+        verifyVairable("analyze_timeout", "1")
+        verifyVairable("analyze_timeout", "43200")
+        verifyVairable("auto_analyze_end_time", "11:11:11")
+        verifyVairable("auto_analyze_end_time", "23:59:59")
+        verifyVairable("auto_analyze_start_time", "22:22:22")
+        verifyVairable("auto_analyze_start_time", "00:00:00")
+        verifyVairable("auto_analyze_table_width_threshold", "3")
+        verifyVairable("auto_analyze_table_width_threshold", "100")
+        verifyVairable("external_table_auto_analyze_interval_in_millis", 
"1234")
+        verifyVairable("external_table_auto_analyze_interval_in_millis", 
"86400000")
+        verifyVairable("huge_table_default_sample_rows", "400000")
+        verifyVairable("huge_table_default_sample_rows", "4194304")
+        verifyVairable("huge_table_lower_bound_size_in_bytes", "55")
+        verifyVairable("huge_table_lower_bound_size_in_bytes", "0")
+        verifyVairable("huge_table_auto_analyze_interval_in_millis", "2345")
+        verifyVairable("huge_table_auto_analyze_interval_in_millis", "0")
+        verifyVairable("table_stats_health_threshold", "11")
+        verifyVairable("table_stats_health_threshold", "60")
+
+    } finally {
+        sql """set global enable_auto_analyze=false"""
+        sql """set global analyze_timeout=43200"""
+        sql """set global auto_analyze_end_time="23:59:59";"""
+        sql """set global auto_analyze_start_time="00:00:00";"""
+        sql """set global auto_analyze_table_width_threshold=100"""
+        sql """set global 
external_table_auto_analyze_interval_in_millis=86400000"""
+        sql """set global huge_table_default_sample_rows=4194304"""
+        sql """set global huge_table_lower_bound_size_in_bytes=0"""
+        sql """set global huge_table_auto_analyze_interval_in_millis=0"""
+        sql """set global table_stats_health_threshold=60"""
+    }
+}
+


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

Reply via email to