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

Correlated fields not detected if subquery has where and group clauses.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • HiveServer2
    • None

    Description

      The following query is failing to compile:

       

      SELECT id
      FROM alltypestiny t1
      WHERE EXISTS
        (SELECT 1
         FROM alltypestiny t2
         WHERE t1.id = t2.id
         GROUP BY t2.id
         HAVING count(1) = 1);
      

       

      The reason it fails is because there is a group by clause and because t1.id is used in the where clause.

      The failure can be traced to code within HiveFilter.traverseFilter, which doesn't find the filter because it returns when it sees the HiveAggregate.

      Attachments

        Activity

          People

            Unassigned Unassigned
            scarlin Steve Carlin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: