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 832f69157d4907..d5ceb465b232be 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 9a99e8bbd94013..ba0363f4197b2c 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);" }