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

hello-stephen 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 1a602f13188 [test](regression) Add debug logging for flaky 
agg_strategy case (#63008)
1a602f13188 is described below

commit 1a602f131889eb067e4845888c18f4876f666c71
Author: feiniaofeiafei <[email protected]>
AuthorDate: Thu May 7 17:38:56 2026 +0800

    [test](regression) Add debug logging for flaky agg_strategy case (#63008)
    
    Add debug logging for flaky agg_strategy case
---
 .../agg_strategy/agg_strategy.groovy               | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git 
a/regression-test/suites/nereids_rules_p0/agg_strategy/agg_strategy.groovy 
b/regression-test/suites/nereids_rules_p0/agg_strategy/agg_strategy.groovy
index a8ca39b64e4..1c200e71138 100644
--- a/regression-test/suites/nereids_rules_p0/agg_strategy/agg_strategy.groovy
+++ b/regression-test/suites/nereids_rules_p0/agg_strategy/agg_strategy.groovy
@@ -85,6 +85,37 @@ suite("agg_strategy") {
 
         qt_agg_distinct_without_gby_key_low_ndv "select count(distinct 
dst_key1) from t_gbykey_2_dstkey_10_30_id"
         qt_agg_distinct_without_gby_key_satisfy_dst_key_low_ndv "select 
count(distinct id) from t_gbykey_2_dstkey_10_30_id"
+
+        // ===== DEBUG BLOCK FOR FLAKY CASE: 
agg_distinct_without_gby_key_with_other_func_low_ndv =====
+        // The next qt has been intermittently failing in cloud_p0 with result 
(4,15) instead of (2,15).
+        // We run it once with profile on; if the result is wrong, dump 
query_id + plan info so the
+        // profile zip can be located under fe/log/profile/ for offline 
analysis.
+        // This block intentionally does NOT use qt_, so it never alters .out 
files.
+        try {
+            def dbgSql = "select count(distinct dst_key1),sum(dst_key1) from 
t_gbykey_2_dstkey_10_30_id"
+            sql "set enable_profile=true"
+            try {
+                def res = sql dbgSql
+                def qid = sql("select last_query_id()")[0][0]
+                if (res.size() != 1 || res[0][0] as long != 2L || res[0][1] as 
long != 15L) {
+                    log.warn("[agg_strategy_debug stat=${i}] WRONG RESULT 
query_id=${qid} got=${res} expected=[[2,15]]")
+                    try {
+                        def shape = sql "explain ${dbgSql}"
+                        log.warn("[agg_strategy_debug stat=${i}] explain :\n" 
+ shape.collect { it[0] }.join("\n"))
+                    } catch (Throwable ignored) {}
+                    try {
+                        def phys = sql "explain physical plan ${dbgSql}"
+                        log.warn("[agg_strategy_debug stat=${i}] explain 
physical plan:\n" + phys.collect { it[0] }.join("\n"))
+                    } catch (Throwable ignored) {}
+                }
+            } finally {
+                sql "set enable_profile=false"
+            }
+        } catch (Throwable dbgEx) {
+            log.warn("[agg_strategy_debug] debug block threw: " + 
dbgEx.getMessage())
+        }
+        // ===== END DEBUG BLOCK =====
+
         qt_agg_distinct_without_gby_key_with_other_func_low_ndv "select 
count(distinct dst_key1),sum(dst_key1) from t_gbykey_2_dstkey_10_30_id"
         
qt_agg_distinct_without_gby_key_satisfy_dst_key_with_other_func_low_ndv "select 
count(distinct id),avg(dst_key1) from t_gbykey_2_dstkey_10_30_id"
 


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

Reply via email to