This is an automated email from the ASF dual-hosted git repository.
dataroaring 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 8afe298a0f [Fix](function) fix function `retention` lost `ARRAY`'s
element type … (#14538)
8afe298a0f is described below
commit 8afe298a0f9d4d57373e2edbce70bd94764e145d
Author: lihangyu <[email protected]>
AuthorDate: Thu Nov 24 15:19:50 2022 +0800
[Fix](function) fix function `retention` lost `ARRAY`'s element type …
(#14538)
---
.../src/main/java/org/apache/doris/catalog/FunctionSet.java | 2 +-
.../aggregate_functions/test_aggregate_retention.out | 3 +++
.../aggregate_functions/test_aggregate_retention.sql | 12 +++++++++++-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java
b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java
index 9eafd40afa..5a3af79237 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionSet.java
@@ -1476,7 +1476,7 @@ public class FunctionSet<T> {
// retention vectorization
addBuiltin(AggregateFunction.createBuiltin(FunctionSet.RETENTION,
Lists.newArrayList(Type.BOOLEAN),
- Type.ARRAY,
+ new ArrayType(Type.BOOLEAN),
Type.VARCHAR,
true,
"",
diff --git
a/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_retention.out
b/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_retention.out
index 97f1b56680..860d353440 100644
---
a/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_retention.out
+++
b/regression-test/data/query_p0/sql_functions/aggregate_functions/test_aggregate_retention.out
@@ -57,3 +57,6 @@
1 [1, 1, 0]
2 [1, 0, 0]
+-- !test_aggregate_retention_13 --
+1
+
diff --git
a/regression-test/suites/query_p0/sql_functions/aggregate_functions/test_aggregate_retention.sql
b/regression-test/suites/query_p0/sql_functions/aggregate_functions/test_aggregate_retention.sql
index ca14c4d3fa..ee7c459896 100644
---
a/regression-test/suites/query_p0/sql_functions/aggregate_functions/test_aggregate_retention.sql
+++
b/regression-test/suites/query_p0/sql_functions/aggregate_functions/test_aggregate_retention.sql
@@ -69,4 +69,14 @@ SELECT
AS r
FROM retention_test
GROUP BY uid
- ORDER BY uid ASC;
\ No newline at end of file
+ ORDER BY uid ASC;
+
+SELECT SUM(cast(a.r[1] AS int))
+FROM
+ (SELECT uid,
+ retention( date = '2022-10-14', date = '2022-10-12', date =
'2022-11-04', date = '2022-11-07') AS r
+ FROM retention_test
+ WHERE (date >= '2022-10-11')
+ AND (date <= '2022-11-21')
+ GROUP BY uid ) a;
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]