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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new e247a801aae Improve analyze stats case, avoid cluster delay caused 
failure. (#32507) (#32605)
e247a801aae is described below

commit e247a801aae9852e5123a5c7e4209cabf946bba6
Author: Jibing-Li <[email protected]>
AuthorDate: Thu Mar 21 15:45:36 2024 +0800

    Improve analyze stats case, avoid cluster delay caused failure. (#32507) 
(#32605)
---
 .../suites/statistics/analyze_stats.groovy         | 55 +++++++++++-----------
 1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/regression-test/suites/statistics/analyze_stats.groovy 
b/regression-test/suites/statistics/analyze_stats.groovy
index 1fa86e52b02..9773a841e66 100644
--- a/regression-test/suites/statistics/analyze_stats.groovy
+++ b/regression-test/suites/statistics/analyze_stats.groovy
@@ -2722,25 +2722,36 @@ PARTITION `p599` VALUES IN (599)
     assertEquals("0.0", result_sample[1][2])
     assertEquals("SAMPLE", result_sample[1][9])
 
-    // Test show task
-    result_sample = sql """analyze table trigger_test with sample percent 10"""
-    String jobId = result_sample[0][0]
-    result_sample = sql """show analyze task status ${jobId}"""
-    assertEquals(2, result_sample.size())
-    Thread.sleep(1000)
-    sql """drop stats trigger_test"""
-
     // Test trigger type
+    sql """drop stats trigger_test"""
     sql """insert into trigger_test values(1,'name1') """
     sql """insert into trigger_test values(2,'name2') """
     sql """insert into trigger_test values(3,'name3') """
     sql """insert into trigger_test values(4,'name4') """
 
-    sql """analyze database trigger PROPERTIES("use.auto.analyzer"="true")"""
+    // Test analyze default full.
+    sql """analyze table trigger_test with sync"""
+    def result = sql """show column stats trigger_test"""
+    assertEquals(2, result.size())
+    assertEquals("4.0", result[0][2])
+    assertEquals("FULL", result[0][9])
+    assertEquals("4.0", result[1][2])
+    assertEquals("FULL", result[1][9])
+
+    // Test manual analyze ignore health value
+    sql """insert into trigger_test values(5,'name5') """
+    sql """analyze table trigger_test with sync"""
+    result = sql """show column stats trigger_test"""
+    assertEquals(2, result.size())
+    assertEquals("5.0", result[0][2])
+    assertEquals("5.0", result[1][2])
 
+    // Test auto analyze with job type SYSTEM
+    sql """drop stats trigger_test"""
+    sql """analyze database trigger PROPERTIES("use.auto.analyzer"="true")"""
     int i = 0;
     for (0; i < 10; i++) {
-        def result = sql """show column stats trigger_test"""
+        result = sql """show column stats trigger_test"""
         if (result.size() != 2) {
             Thread.sleep(1000)
             continue;
@@ -2751,29 +2762,17 @@ PARTITION `p599` VALUES IN (599)
     }
     if (i < 10) {
         sql """analyze table trigger_test with sync"""
-        def result = sql """show column stats trigger_test"""
+        result = sql """show column stats trigger_test"""
         assertEquals(result.size(), 2)
         assertEquals(result[0][11], "MANUAL")
         assertEquals(result[1][11], "MANUAL")
     }
 
-    // Test analyze default full.
-    sql """analyze table trigger_test with sync"""
-    def result = sql """show column stats trigger_test"""
-    assertEquals(2, result.size())
-    assertEquals("4.0", result[0][2])
-    assertEquals("FULL", result[0][9])
-    assertEquals("4.0", result[1][2])
-    assertEquals("FULL", result[1][9])
-
-    // Test analyze hive health value
-    sql """insert into trigger_test values(5,'name5') """
-    sql """analyze table trigger_test with sync"""
-    result = sql """show column stats trigger_test"""
-    assertEquals(2, result.size())
-    assertEquals("5.0", result[0][2])
-    assertEquals("5.0", result[1][2])
-
+    // Test show task
+    result_sample = sql """analyze table trigger_test with sample percent 10"""
+    String jobId = result_sample[0][0]
+    result_sample = sql """show analyze task status ${jobId}"""
+    assertEquals(2, result_sample.size())
 
     sql """DROP DATABASE IF EXISTS trigger"""
 }


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

Reply via email to