SQL中IS NOT NULL 判断报错

版本:1.19.3
当前SQL
执行下面SQL时,不加红框处执行正常,加上红框处条件就报unknown error 。

fe.log报错信息如下:
test.log (10.2 KB)

set enable_cbo=true试试设置这个之后可以查询吗

cbo是默认开启,这个没有关闭过。

抱歉,刚才说错了,先关了看看。set enable_cbo=false试试设置这个之后可以查询吗

关闭cbo之后,会报dc_user_id 字段不识别的错误

辛苦发下脱敏后的建表语句

create table v_event
(
dt DATE,
event VARCHAR(50) default ‘0’,
ds DATETIME default ‘’,
ts BIGINT default ‘0’ ,
user_id VARCHAR(50) default ‘0’,
dc_user_id BIGINT,
platform VARCHAR(50) default ‘0’,
channel VARCHAR(50) default ‘0’,
server VARCHAR(50) default ‘0’,
device_id VARCHAR(100) default ‘0’,
order_id VARCHAR(50) default ‘’,
pay_amount DOUBLE default ‘0.0’,
ip VARCHAR(50) default ‘0’
)
DUPLICATE KEY(dt,event,ds)
PARTITION BY RANGE(dt)
(
START (“2021-01-01”) END (“2025-01-01”) EVERY (INTERVAL 1 DAY)
)
DISTRIBUTED BY HASH(dc_user_id) BUCKETS 32
PROPERTIES(
“dynamic_partition.enable” = “true”,
“dynamic_partition.time_unit” = “DAY”,
“dynamic_partition.prefix” = “p”,
“dynamic_partition.end” = “3”,
“dynamic_partition.buckets” = “32”,
“replication_num” = “3”
);
以上是表结构,请看看是什么问题导致的。
下面是SQL语句
select * from (

select group_0,dc_user_id,min_time, abs (minutes_diff(split( UNNEST ,’=’)[1],min_time)), if ( abs (minutes_diff(split( UNNEST ,’=’)[1],min_time)) <=1,split( UNNEST ,’=’)[2], null ) indexType from (

select group_0,dc_user_id,date_map, UNNEST min_time from (

select group_0,dc_user_id,group_concat( CONCAT_ws (’,’, if (indexType=1,date_time, null ))) datetimes,group_concat( concat (date_time,’=’,indexType)) date_map from (

select ds date_time,channel group_0,dc_user_id,1 indexType

from v_event where dt between ‘2021-11-30’ and ‘2021-12-08’ and event=‘pay_end’ and ((pay_amount > 1000))

union all

select ds date_time,channel group_0,dc_user_id,2 indexType

from v_event where dt between ‘2021-11-30’ and ‘2021-12-08’ and event=‘pay_end’ and ((pay_amount > 10000))

union all

select ds date_time,channel group_0,dc_user_id,3 indexType

from v_event where dt between ‘2021-11-30’ and ‘2021-12-08’ and event=‘pay_end’ and ((pay_amount > 100000))

) t where dc_user_id is not null group by group_0,dc_user_id

) t, UNNEST (split(datetimes,’,’))

) t, UNNEST (split(date_map,’,’))

) t where indexType is not null