如何关闭优化器?

Viewed 25

版本2.1.3/2.1.5,执行以下sql报错[HY000][1105] errCode = 2, detailMessage = (10.8.12.73)[CANCELLED]UdfRuntimeException: UDF failed to evaluate CAUSED BY: NullPointerException: null 通过explain得知doris优化器自动合并子句的筛选条件,但是我需要基于子查询的结果进行处理。
官方文档提供的关闭优化器方法并不生效,请问我应该如何做?

select
      split_by_string(reason, '\n') as reasons, db_name, tb_name
from (
       select HTTP_GET(json_unquote(json_extract(stdout, '$.ErrorURL')), '{"body": {}}') as reason,
              json_unquote(json_extract(stdout, '$.db'))    as db_name,
              json_unquote(json_extract(stdout, '$.table')) as tb_name
       from (
                select split_by_string(stdout, '@@:::::::@@')[1] as stdout
                from (
                         select appId, HTTP_GET(concat('http://dw1:8088/proxy/', appId, '/taskmanagers/', containerId, '/stdout'), '{"body": {}}') as stdout
                         from (
                                  select appId, min(json_unquote(json_extract(json_arr_get(TaskManagersMemInfo, t), '$.id'))) as containerId
                                  from doris_audit_db__.flink_metrics partition (p20240903)
                                           lateral view EXPLODE_NUMBERS(json_arr_size(TaskManagersMemInfo)) tmp as t
                                  where TaskManagersMemInfo is not null
                                    and TaskManagersMemInfo != '[]'
                                    and exceptions != '[]'
                                    and metricTime between '2024-09-03 11:08:00' and '2024-09-03 11:09:00'
                                  group by appId
                              ) t
                     ) t1
                where locate('@@:::::::@@', stdout) > 0
            ) t2
   ) t3
where locate('Reason', reason) > 0
1 Answers

执行这个语句试试

SET global enable_nereids_planner=true;