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

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

commit 7b2d78dfa3d0ee3f9beccb497cb66d1388e2d3c5
Author: Pxl <[email protected]>
AuthorDate: Fri Sep 1 14:57:12 2023 +0800

    [Bug](cte) fix multi cast data stream source not open expr (#23740)
    
    fix multi cast data stream source not open expr
---
 be/src/pipeline/exec/multi_cast_data_stream_source.cpp |  6 ++++++
 regression-test/data/nereids_syntax_p0/cte.out         |  4 ++++
 regression-test/suites/nereids_syntax_p0/cte.groovy    | 18 ++++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/be/src/pipeline/exec/multi_cast_data_stream_source.cpp 
b/be/src/pipeline/exec/multi_cast_data_stream_source.cpp
index 216c626330..33b358cd08 100644
--- a/be/src/pipeline/exec/multi_cast_data_stream_source.cpp
+++ b/be/src/pipeline/exec/multi_cast_data_stream_source.cpp
@@ -72,6 +72,12 @@ Status 
MultiCastDataStreamerSourceOperator::prepare(doris::RuntimeState* state)
 }
 
 Status MultiCastDataStreamerSourceOperator::open(doris::RuntimeState* state) {
+    if (_t_data_stream_sink.__isset.output_exprs) {
+        RETURN_IF_ERROR(vectorized::VExpr::open(_output_expr_contexts, state));
+    }
+    if (_t_data_stream_sink.__isset.conjuncts) {
+        RETURN_IF_ERROR(vectorized::VExpr::open(_conjuncts, state));
+    }
     return _acquire_runtime_filter();
 }
 
diff --git a/regression-test/data/nereids_syntax_p0/cte.out 
b/regression-test/data/nereids_syntax_p0/cte.out
index 414dd7f9c1..b9efc81fdc 100644
--- a/regression-test/data/nereids_syntax_p0/cte.out
+++ b/regression-test/data/nereids_syntax_p0/cte.out
@@ -82,3 +82,7 @@ ASIA  1
 15
 29
 
+-- !test --
+1      2023-08-25 00:00:00     10      10
+1      2023-08-25 01:00:00     20      30
+
diff --git a/regression-test/suites/nereids_syntax_p0/cte.groovy 
b/regression-test/suites/nereids_syntax_p0/cte.groovy
index 15a7afc955..2fffefd806 100644
--- a/regression-test/suites/nereids_syntax_p0/cte.groovy
+++ b/regression-test/suites/nereids_syntax_p0/cte.groovy
@@ -306,5 +306,23 @@ suite("cte") {
         notContains "MultiCastDataSinks"
     }
 
+    sql "WITH cte_0 AS ( SELECT 1 AS a ) SELECT * from cte_0 t1 LIMIT 10 UNION 
SELECT * from cte_0 t1 LIMIT 10"
+
+    qt_test """
+        SELECT * FROM (
+        WITH temptable as (
+        SELECT 1 Id, '2023-08-25 00:00:00' UpdateDateTime, 10 Value
+        UNION
+        SELECT 1 Id, '2023-08-25 01:00:00' UpdateDateTime, 20 Value
+        )
+        SELECT temptable.Id, temptable.UpdateDateTime, temptable.Value, 
rolling.RollingValue FROM temptable
+        LEFT JOIN (
+        SELECT Id, UpdateDateTime, SUM(Value) OVER (PARTITION BY 
CAST(UpdateDateTime AS DATE) ORDER BY UpdateDateTime) AS RollingValue
+        FROM temptable
+        GROUP BY Id, UpdateDateTime, Value
+        ) rolling ON temptable.Id = rolling.Id AND temptable.UpdateDateTime = 
rolling.UpdateDateTime
+        ) tab
+        WHERE Id IN (1, 2)
+    """
 }
 


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

Reply via email to