select
        tmp1.task_no                as task_no
        ,count(tmp1.ucid)           as task_acc_exposure_pv
        ,count(distinct tmp1.ucid)  as task_acc_exposure_uv
    from
    (
        select
            task_no
            ,ucid
        from (
            select
                get_json_object(action,'$.task_no') as task_no
                ,ucid
                ,evt_id
            from dwd.dwd_comm_raw_log_b_alliance_log_info_di
            where pt >= '${-1d_yyyyMM01000000}'
            and pt <= '${-1d_pt}'
            and evt_type = 'e'
            and dp = 'app'
            and evt_id in ('20440','20441')    
            and pid= 'a_app'
            and get_json_object(action,'$.task_no') is not null
            and get_json_object(action,'$.task_no') <> -911
        ) t
        where evt_id = '20440'
        union all
        select
            task_no
            ,ucid
        from (
            select
                tmp2.task_no        as task_no
                ,tmp2.ucid          as ucid
                ,tmp2.evt_id        as evt_id
            from
            (
                select
                    task_no
                    ,tmp1.ucid    as ucid
                    ,tmp1.evt_id    as evt_id
                from
                (
                    select
                        get_json_object(action,'$.hxrenwuid') as tmp_task_no
                        ,ucid
                        ,evt_id
                    from dwd.dwd_comm_raw_log_b_alliance_log_info_di
                    where pt >= '${-1d_yyyyMM01000000}'
                    and pt <= '${-1d_pt}'
                    and evt_type = 'e'
                    and dp = 'app'
                    and evt_id in ('34154','33184') 
                    and pid= 'a_m'
                    and get_json_object(action,'$.hxrenwuid') is not null
                ) tmp1 
                lateral view explode(split(tmp_task_no,'\073')) explode    as task_no
            ) tmp2
            where tmp2.task_no not in ('-911','')
        ) t
        where evt_id = '34154'
    )tmp1
    group by tmp1.task_no

I got this problem when I ran the above sql:SemanticException when trying to remove partition predicates: fail to find child from parent

I tried to create temporary tables without subqueries and it worked. I want to ask what is the reason for this problem

0

There are 0 best solutions below