t_attendance_employee_month_fba8b77df8.c_custom_data 是我们自己定义的一个map数据类型
在执行sql的时候,如果我们在select中选择了这个字段,sql执行就会报错,如果不查询这个字段中的数据,sql是能够正常执行的。选择这个字段后,报错信息如下:
[HY000][1105] errCode = 2, detailMessage = (10.21.16.3)[CANCELLED][E-123][E-123] Bad cast from type doris::vectorized::ColumnNullable to doris::vectorized::ColumnArray 0. /root/src/doris-2.0/be/src/common/stack_trace.cpp:302: StackTrace::tryCapture() @ 0x000000000b8a51a7 in /opt/apache-doris/be/lib/doris_be 1. /root/src/doris-2.0/be/src/common/stack_trace.h:0: doris::get_stack_traceabi:cxx11 @ 0x000000000b8a377d in /opt/apache-doris/be/lib/doris_be 2. /var/local/ldb-toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/unique_ptr.h:173: doris::Exception::Exception(int, std::basic_string_view<char, std::char_traits >) @ 0x000000000b349b3e in /opt/apache-doris/be/lib/doris_be 3. /root/src/doris-2.0/be/src/vec/common/typeid_cast.h:0: doris::vectorized::ColumnArray& typeid_cast<doris::vectorized::ColumnArray&, doris::vectorized::IColumn>(doris::vectorized::IColumn&) @ 0x000000000d96e450 in /opt/apache-doris/be/lib/doris ...
报错的sql如下:
SELECT t_attendance_employee_month_fba8b77df8.c_company_id,
cast(`t_attendance_employee_month_fba8b77df8`.`c_custom_data`['ASYS20001'] as DECIMAL),
case when t_attendance_employee_month_fba8b77df8.c_custom_data is not null then
t_attendance_employee_month_fba8b77df8.c_custom_data['ASYS20001']
else 'array(1,2)' end as custom_data_keys,
`t_personnel_employee_info_14a3f6be8c`.`c_date` AS `c_date`
FROM (SELECT *
FROM (select *,
get_explode_date_list('2024-03-18', '2024-03-25', c_effective_dt, c_invalid_dt, 3,
2) as dt
from dashboard.personnel_employee_info
WHERE c_company_id = '6e93233ef19a4220be4816d341afcdc1'
) x LATERAL VIEW explode(dt) tableName AS c_date
WHERE c_date != '') `t_personnel_employee_info_14a3f6be8c`
inner join (select *
from (
SELECT *,
case
when c_belong_date > '2024-02-29 23:59:59' and
c_belong_date <= '2024-03-31 23:59:59' then '2024-03-01'
end c_date
FROM dashboard.attendance_employee_month
WHERE c_company_id = '6e93233ef19a4220be4816d341afcdc1'
) t
where c_date is not null
) `t_attendance_employee_month_fba8b77df8` on
`t_personnel_employee_info_14a3f6be8c`.c_date = `t_attendance_employee_month_fba8b77df8`.c_date
inner join (SELECT *
FROM (select *,
get_explode_date_list('2024-03-18', '2024-03-25', c_effective_dt,
c_invalid_dt, 3, 2) as dt
from dashboard.personnel_department
WHERE c_company_id = '6e93233ef19a4220be4816d341afcdc1'
and `c_department_id` IN
('1f03fb94386046da8379e35c3b3c60d8', '096339341f6f4d65bf528252c2fcd85d',
'23f117e21e5344848ddc232e333ba5fa', '366e7b43b8d84e41b170c2db4b6e5d4e',
'1471098923084ee4868d6f4101d4f774', '67b997fabc714530b23c83eea99fdf86',
'ace8883be6c54bf98ed2a47155716268')
) x LATERAL VIEW explode(dt) tableName AS c_date
WHERE c_date != '') `t_personnel_department_a8bdf95420` on
`t_personnel_employee_info_14a3f6be8c`.c_date = `t_personnel_department_a8bdf95420`.c_date;
可正常执行的sql如下:
SELECT t_attendance_employee_month_fba8b77df8.c_company_id,
`t_personnel_employee_info_14a3f6be8c`.`c_date` AS `c_date`
FROM (SELECT *
FROM (select *,
get_explode_date_list('2024-03-18', '2024-03-25', c_effective_dt, c_invalid_dt, 3,
2) as dt
from dashboard.personnel_employee_info
WHERE c_company_id = '6e93233ef19a4220be4816d341afcdc1'
) x LATERAL VIEW explode(dt) tableName AS c_date
WHERE c_date != '') `t_personnel_employee_info_14a3f6be8c`
inner join (select *
from (
SELECT *,
case
when c_belong_date > '2024-02-29 23:59:59' and
c_belong_date <= '2024-03-31 23:59:59' then '2024-03-01'
end c_date
FROM dashboard.attendance_employee_month
WHERE c_company_id = '6e93233ef19a4220be4816d341afcdc1'
) t
where c_date is not null
) `t_attendance_employee_month_fba8b77df8` on
`t_personnel_employee_info_14a3f6be8c`.c_date = `t_attendance_employee_month_fba8b77df8`.c_date
inner join (SELECT *
FROM (select *,
get_explode_date_list('2024-03-18', '2024-03-25', c_effective_dt,
c_invalid_dt, 3, 2) as dt
from dashboard.personnel_department
WHERE c_company_id = '6e93233ef19a4220be4816d341afcdc1'
and `c_department_id` IN
('1f03fb94386046da8379e35c3b3c60d8', '096339341f6f4d65bf528252c2fcd85d',
'23f117e21e5344848ddc232e333ba5fa', '366e7b43b8d84e41b170c2db4b6e5d4e',
'1471098923084ee4868d6f4101d4f774', '67b997fabc714530b23c83eea99fdf86',
'ace8883be6c54bf98ed2a47155716268')
) x LATERAL VIEW explode(dt) tableName AS c_date
WHERE c_date != '') `t_personnel_department_a8bdf95420` on
`t_personnel_employee_info_14a3f6be8c`.c_date = `t_personnel_department_a8bdf95420`.c_date;
请问下这个该怎么处理?