【已记录】2.1.2版本执行sql报错:couldn't resolve slot descriptor 56, desc

Viewed 81

报错信息截图

报错信息截图

在2.1.2版本执行一段sql报错:

couldn't resolve slot descriptor 56, desc: tuples: Tuple(id=14 slots=[Slot(id=257 type=VARCHAR col=-1, colname=source_system, nullable=1)

执行的sql:

with tmp as (
    select
        t1.*,left(date_add(t2.max_business_date, interval 1 day),10) as max_business_date
    from dw.dwd_property_daily_info t1
             join (
        select
            building_id,
            property_code,
            min(business_date) as business_date,
            max(business_date) as max_business_date
        from dw.dwd_property_daily_info
        where business_date >= '2024-04-15'
          and contract_no is null
        group by property_code,building_id
    ) t2
                  on t1.building_id = t2.building_id
                      and t1.business_date >= t2.business_date
                      and t1.property_code = t2.property_code
)
   , tmp2 as (
    select
        *
    from tmp
    where max_business_date = business_date
      and left(start_date, 10) <= business_date
)select
     t1.source_system,
     t1.building_id,
     t1.property_code,
     t1.business_date,
     t1.property_name,
     t1.type,
     t1.is_active,
     t1.property_status,
     coalesce(t2.contract_no,t1.contract_no) as contract_no,
     coalesce(t2.contract_category,t1.contract_category),
     coalesce(t2.actual_confirm_date,t1.actual_confirm_date),
     coalesce(t2.start_date,t1.start_date),
     coalesce(t2.actual_open_date,t1.actual_open_date),
     coalesce(t2.actual_end_date,t1.actual_end_date),
     coalesce(t2.contract_status, t1.contract_status),
     coalesce(t2.contract_status_a,t1.contract_status_a),
     coalesce(t2.area_total,t1.area_total),
     coalesce(t2.rented_area,t1.rented_area),
     coalesce(t2.rental_area,t1.rental_area),
     coalesce(t2.opening_area,t1.opening_area),
     t1.insertdate,
     now()
from (select * from tmp where contract_no is null) t1
         left join tmp2 t2
                   on t1.building_id = t2.building_id
                       and t1.property_code = t2.property_code
1 Answers

【问题状态】已处理
【问题处理】当前可以临时把business_date自动由varcher改为date解决;后续可升级至 > 2.0.3-rc03的版本,已经修复,具体详细可查阅如下fix pr:https://github.com/apache/doris/pull/34079