oceanbase / sql-lifecycle-management

SQL-Lifecycle-Management is an intelligent diagnosis and optimization product focusing on the SQL field.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: parser error in table alias

Ifffff opened this issue · comments

commented

Describe the bug

select 
  count(1) as job_count, 
  date_format(y.gmtdate, '%m-%d') as time_node 
from 
  (
    (
      select 
        a.tenant_id, 
        a.namespace_id, 
        a.project_id, 
        a.group_name, 
        a.flow_name, 
        a.script_type, 
        a.status, 
        a.is_deleted, 
        a.task_name, 
        a.task_id, 
        a.owner, 
        a.activity_name, 
        a.schedule_type, 
        a.task_type, 
        a.gmt_create, 
        b.rule_type, 
        b.activity_inst_id, 
        b.biz_date 
      from 
        (
          select 
            rule_type, 
            task_id, 
            activity_inst_id, 
            biz_date 
          from 
            jss_alarm_log 
          where 
            1 = 1 
            and rule_type = 5 
          group by 
            activity_inst_id
        ) b 
        inner join (
          select 
            a1.tenant_id, 
            a1.namespace_id, 
            a1.project_id, 
            a1.group_name, 
            a1.flow_id, 
            a2.flow_name, 
            a2.script_type, 
            a2.status, 
            a2.task_name, 
            a2.task_id, 
            a2.owner, 
            a2.activity_name, 
            a2.schedule_type, 
            a2.task_type, 
            a2.gmt_create, 
            a2.is_deleted 
          from 
            (
              select 
                a11.tenant_id, 
                a11.namespace_id, 
                a11.project_id, 
                a11.group_name, 
                a12.flow_name as flow_name_1, 
                a12.id as flow_id 
              from 
                (
                  select 
                    p.tenant_id, 
                    p.namespace_id, 
                    p.project_id, 
                    q.group_name 
                  from 
                    jss_user_group_relation p 
                    inner join jss_cdf_group_def q on p.group_id = q.group_id 
                    and p.tenant_id = '0000070002' 
                    and p.namespace_id = 'e96d6777-d7fd-478f-ab8c-8df25877dff5'
                ) a11 
                inner join jss_cdf_flow_def a12 on a11.group_name = a12.group_name
            ) a1 
            inner join jss_task_define a2 on a1.flow_name_1 = a2.flow_name 
            and a2.activity_name <> 'startactivity' 
            and a2.is_deleted = 0 
            and a2.owner = '0005293676'
        ) a on a.task_id = b.task_id
    ) x 
    inner join ods_phoenix_task_inst y on x.activity_inst_id = y.task_id 
    and y.dag_type = 0
  ) 
group by 
  bizdate 
order by 
  bizdate

an error happened when parser this sql.

SyntaxError: The current version does not support this SQL 6 (x)