Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-24969

Predicates may be removed when decorrelating subqueries with lateral

    XMLWordPrintableJSON

Details

    Description

      Step to reproduce:

      select count(distinct logItem.triggerId)
      from service_stat_log LATERAL VIEW explode(logItems) LogItemTable AS logItem
      where logItem.dsp in ('delivery', 'ocpa')
      and logItem.iswin = true
      and logItem.adid in (
       select distinct adId
       from ad_info
       where subAccountId in (16010, 14863));  

      For predicates logItem.dsp in ('delivery', 'ocpa')  and logItem.iswin = true are removed when doing ppd: JOIN ->   RS  -> LVJ.  The JOIN has candicates: logitem -> [logItem.dsp in ('delivery', 'ocpa'), logItem.iswin = true],when pushing them to the RS followed by LVJ,  none of them are pushed, the candicates of logitem are removed finally by default, which cause to the wrong result.

      Attachments

        Issue Links

          Activity

            People

              dengzh Zhihua Deng
              dengzh Zhihua Deng
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 40m
                  3h 40m