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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 8d580e9163a branch-3.0: [Bug](function)window funnel function should 
support datetimev2 type get scale info #44420 (#44523)
8d580e9163a is described below

commit 8d580e9163adadfbfdb6ec7c08c5bb277742c740
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Nov 29 19:37:28 2024 +0800

    branch-3.0: [Bug](function)window funnel function should support datetimev2 
type get scale info #44420 (#44523)
    
    Cherry-picked from #44420
    
    Co-authored-by: zhangstar333 <zhangs...@selectdb.com>
---
 .../expressions/functions/agg/WindowFunnel.java     |  4 ++++
 .../data/nereids_p0/aggregate/window_funnel.out     |  3 +++
 .../nereids_p0/aggregate/window_funnel.groovy       | 21 +++++++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java
index 11d920530e8..7679b5a4905 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/WindowFunnel.java
@@ -44,8 +44,12 @@ public class WindowFunnel extends NullableAggregateFunction
         implements ExplicitlyCastableSignature {
 
     public static final List<FunctionSignature> SIGNATURES = ImmutableList.of(
+            FunctionSignature.ret(IntegerType.INSTANCE)
+                    .varArgs(BigIntType.INSTANCE, StringType.INSTANCE, 
DateTimeV2Type.SYSTEM_DEFAULT,
+                            BooleanType.INSTANCE),
             FunctionSignature.ret(IntegerType.INSTANCE)
                     .varArgs(BigIntType.INSTANCE, StringType.INSTANCE, 
DateTimeType.INSTANCE, BooleanType.INSTANCE)
+
     );
 
     /**
diff --git a/regression-test/data/nereids_p0/aggregate/window_funnel.out 
b/regression-test/data/nereids_p0/aggregate/window_funnel.out
index 0bbe397fe3e..f9c24637999 100644
--- a/regression-test/data/nereids_p0/aggregate/window_funnel.out
+++ b/regression-test/data/nereids_p0/aggregate/window_funnel.out
@@ -128,3 +128,6 @@
 100126 2
 100127 2
 
+-- !window_funnel_datetimev2 --
+2
+
diff --git a/regression-test/suites/nereids_p0/aggregate/window_funnel.groovy 
b/regression-test/suites/nereids_p0/aggregate/window_funnel.groovy
index 378311a575f..186e65461da 100644
--- a/regression-test/suites/nereids_p0/aggregate/window_funnel.groovy
+++ b/regression-test/suites/nereids_p0/aggregate/window_funnel.groovy
@@ -720,4 +720,25 @@ suite("window_funnel") {
         order BY user_id
     """
 
+    sql """ DROP TABLE IF EXISTS windowfunnel_test_1 """
+    sql """
+        CREATE TABLE windowfunnel_test_1 (
+            `xwho` varchar(50) NULL COMMENT 'xwho',
+            `xwhen` datetime(3) COMMENT 'xwhen',
+            `xwhat` int NULL COMMENT 'xwhat'
+        ) DUPLICATE KEY(xwho)
+        DISTRIBUTED BY HASH(xwho) BUCKETS 3
+        PROPERTIES ("replication_num" = "1");
+    """
+    sql """ INSERT INTO windowfunnel_test_1 (xwho, xwhen, xwhat) VALUES
+        ('1', '2022-03-12 10:41:00.111', 1),  
+        ('1', '2022-03-12 10:41:00.888', 2),  
+        ('1', '2022-03-12 13:28:02.177', 3),  
+        ('1', '2022-03-12 16:15:01.444', 4);  """
+    explain {
+        sql("""select window_funnel(3600 * 3, 'deduplication', t.xwhen, 
t.xwhat = 1, t.xwhat = 2 ) AS level from windowfunnel_test_1 t;""")
+        notContains("cast")
+    }
+
+    qt_window_funnel_datetimev2 """select window_funnel(3600 * 3, 
'deduplication', t.xwhen, t.xwhat = 1, t.xwhat = 2 ) AS level from 
windowfunnel_test_1 t; """
 }


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

Reply via email to