This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 a979d5a1f03 [improve](regression test) Add case for if function
(#25780)
a979d5a1f03 is described below
commit a979d5a1f03d86a8420e7a3faf500f86b33d7a85
Author: zhiqiang <[email protected]>
AuthorDate: Wed Oct 25 01:03:28 2023 -0500
[improve](regression test) Add case for if function (#25780)
---
.../query_p0/sql_functions/conditional_functions/test_if.out | 11 +++++++++++
.../sql_functions/conditional_functions/test_if.groovy | 7 +++++++
2 files changed, 18 insertions(+)
diff --git
a/regression-test/data/query_p0/sql_functions/conditional_functions/test_if.out
b/regression-test/data/query_p0/sql_functions/conditional_functions/test_if.out
index 832f69157d4..d5ceb465b23 100644
---
a/regression-test/data/query_p0/sql_functions/conditional_functions/test_if.out
+++
b/regression-test/data/query_p0/sql_functions/conditional_functions/test_if.out
@@ -11,3 +11,14 @@
-- !select --
[]
+-- !select --
+true 1
+
+-- !select --
+true
+
+-- !select --
+true 1
+
+-- !select --
+true
diff --git
a/regression-test/suites/query_p0/sql_functions/conditional_functions/test_if.groovy
b/regression-test/suites/query_p0/sql_functions/conditional_functions/test_if.groovy
index 9a99e8bbd94..ba0363f4197 100644
---
a/regression-test/suites/query_p0/sql_functions/conditional_functions/test_if.groovy
+++
b/regression-test/suites/query_p0/sql_functions/conditional_functions/test_if.groovy
@@ -21,4 +21,11 @@ suite("test_if") {
qt_select "select if(job_d is null, array(), job_d) as test from (select
array('1970-01-01', '1970-01-01') as job_d) t"
qt_select "select if(job_d is null, array('1970-01-01'), job_d) as test
from (select array('1970-01-01', '1970-01-01') as job_d) t"
qt_select "select if(job_d is null, job_d, array()) as test from (select
array('1970-01-01', '1970-01-01') as job_d) t"
+
+ // user case https://github.com/apache/doris/issues/25644
+ qt_select "SELECT /*+SET_VAR(enable_nereids_planner=true)*/ NOT
ISNULL(CASE WHEN IFNULL ((t1.region IN ('US')),0) THEN t1.region ELSE 'other'
END) AS account_id, count(*) FROM (select 'US' AS region) as t1 group by 1"
+ qt_select "SELECT /*+SET_VAR(enable_nereids_planner=true)*/ NOT
ISNULL(CASE WHEN IFNULL (('US' IN ('US')),0) THEN 'US' ELSE 'other' END);"
+
+ qt_select "SELECT /*+SET_VAR(enable_nereids_planner=false)*/ NOT
ISNULL(CASE WHEN IFNULL ((t1.region IN ('US')),0) THEN t1.region ELSE 'other'
END) AS account_id, count(*) FROM (select 'US' AS region) as t1 group by 1"
+ qt_select "SELECT /*+SET_VAR(enable_nereids_planner=false)*/ NOT
ISNULL(CASE WHEN IFNULL (('US' IN ('US')),0) THEN 'US' ELSE 'other' END);"
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]