Copilot commented on code in PR #62043:
URL: https://github.com/apache/doris/pull/62043#discussion_r3026394693


##########
be/test/exprs/aggregate/vec_window_funnel_v2_test.cpp:
##########
@@ -1164,4 +1164,168 @@ TEST_F(VWindowFunnelV2Test, 
testIncreaseModeOldChainBetter) {
     }
 }
 
-} // namespace doris
+// Test DEDUPLICATION mode: same-row multi-event matching should NOT break the 
chain.
+// This is the exact scenario from the bug report where V1 returns 3 but V2 
returned 2.
+//
+// 3 conditions, window=1 day (86400s), DEDUPLICATION mode
+//   Row 0 (t=10:00): event1=T, event2=T, event3=F  → matches E0+E1 on same row
+//   Row 1 (t=11:00): event1=T, event2=T, event3=F  → matches E0+E1 on same row

Review Comment:
   The file opens `namespace doris {` near the top (line 41), but it is no 
longer closed at the end of the file after adding these tests. This will break 
compilation due to an unclosed namespace. Add the corresponding `} // namespace 
doris` at the end of the file (or otherwise ensure namespaces are correctly 
balanced).



##########
regression-test/suites/query_p0/aggregate/window_funnel_v2.groovy:
##########
@@ -486,5 +486,66 @@ suite("window_funnel_v2") {
         from windowfunnel_v2_test t;
     """
 
+    // ==================== DEDUPLICATION mode: same-row multi-event bug fix 
====================
+    // Regression test for the bug where deduplication mode incorrectly breaks 
the chain
+    // when a single row matches multiple conditions including E0.
+    // V1 returns 3, V2 was returning 2 before the fix.
+    sql """ DROP TABLE IF EXISTS windowfunnel_v2_test """
+    sql """
+        CREATE TABLE IF NOT EXISTS windowfunnel_v2_test (
+            xwho varchar(50) NULL COMMENT 'xwho',
+            xwhen datetimev2(3) COMMENT 'xwhen',
+            xwhat int NULL COMMENT 'xwhat'
+        )
+        DUPLICATE KEY(xwho)
+        DISTRIBUTED BY HASH(xwho) BUCKETS 3
+        PROPERTIES (
+        "replication_num" = "1"
+        );
+    """
+    // Case 1: Rows matching both E0+E1 or E0+E2 simultaneously.
+    // Row 0 (t=10:00): xwhat=1 → matches E0 (xwhat=1) and E1 (xwhat!=2)
+    // Row 1 (t=11:00): xwhat=1 → matches E0 (xwhat=1) and E1 (xwhat!=2)
+    // Row 2 (t=12:00): xwhat=3 → matches E0 (xwhat=1 false, but see below), 
E1 (xwhat!=2) and E2 (xwhat=3)
+    // Using conditions: xwhat=1, xwhat!=2, xwhat=3
+    // Row 0: E0=T(1=1), E1=T(1!=2), E2=F(1!=3) → same-row E0+E1
+    // Row 1: E0=T(1=1), E1=T(1!=2), E2=F(1!=3) → same-row E0+E1
+    // Row 2: E0=F(3!=1), E1=T(3!=2), E2=T(3=3) → same-row E1+E2

Review Comment:
   The inline explanation for Row 2 is internally inconsistent/misleading: it 
says the row "matches E0" even though `xwhat=3` does not satisfy the first 
condition (`xwhat = 1`). Consider rewriting this comment to avoid suggesting E0 
matches on Row 2, so the test case description stays accurate for future 
readers.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to