[ 
https://issues.apache.org/jira/browse/TRAFODION-2444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15901497#comment-15901497
 ] 

liu ming commented on TRAFODION-2444:
-------------------------------------

To reproduced the error, one can run this simplified DML:

prepare s from 
SELECT  '1' data_detai
FROM 
( 
    SELECT 
                case when m.MP_LEVEL > 1 AND NOT EXISTS
                (SELECT 1 FROM trafodion.nanrui_1.C_BILL_RELA r WHERE r.MP_ID = 
m.MP_ID) 
                then 1 end RULL_12 
        from hive.porc.c_mp m, hive.porc.C_CONS c
                where c.CONS_ID = m.CONS_ID
)

union all

SELECT  nvl(sum(RULL_01), 0) || ',' ||    nvl(sum(RULL_04), 0) data_detai
FROM 
(
        select case when m.STATUS_CODE = '02'
                                        and exists
                                                (select 1 from 
hive.porc.D_METER d
                         WHERE t.METER_ID = d.METER_ID ) 
                                then 1 end RULL_01,
                                                 
               case when exists (SELECT 1
                          FROM  trafodion.nanrui_1.c_mp_IT_RELA y
                         WHERE   y.MP_ID = m.MP_ID
                           ) then 1 end RULL_04
        from hive.porc.C_Meter t, hive.porc.c_mp m 
         where  m.STATUS_CODE <> '04' 
);

> compile failed with 3 union alls
> --------------------------------
>
>                 Key: TRAFODION-2444
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2444
>             Project: Apache Trafodion
>          Issue Type: Bug
>            Reporter: Joshua Liu
>            Assignee: Suresh Subbiah
>         Attachments: 三个union all编译出错,单独编译都能通过.msg
>
>
> the sql is like:
> ----------
> query1
> union all
> query 2
> union all
> query3
> ----------
> it compiled failed
> but query1&2&3 can compile successfully respectively.
> see attachment for more details...



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to