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

CBO trunk merge: union11 test fails due to incorrect plan

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 0.14.0
    • None
    • None

    Description

      The result changes to as if the union didn't have count() inside. The issue can be fixed by using srcunion.value outside the subquery in count (replace count(1) with count(srcunion.value)). Otherwise, it looks like count(1) node from union-ed queries is not present in AST at all, which might cause this result.

      Interestingly, adding group by to each query in a union produces completely weird result (count(1) is 309 for each key, whereas it should be 1 and the "logical" incorrect value if internal count is lost is 500) Nm, that groups by table column called key, which is weird but is what Hive does

      Attachments

        1. HIVE-8225.1.patch
          11 kB
          Pengcheng Xiong
        2. HIVE-8225.2.patch
          10 kB
          Pengcheng Xiong
        3. HIVE-8225.3.patch
          15 kB
          Pengcheng Xiong
        4. HIVE-8225.4.patch
          15 kB
          Pengcheng Xiong
        5. HIVE-8225.5.patch
          15 kB
          Pengcheng Xiong
        6. HIVE-8225.6.patch
          15 kB
          Pengcheng Xiong
        7. HIVE-8225.7.patch
          15 kB
          Pengcheng Xiong
        8. HIVE-8225.8.patch
          15 kB
          Pengcheng Xiong
        9. HIVE-8225.inprogress.patch
          16 kB
          Sergey Shelukhin
        10. HIVE-8225.inprogress.patch
          16 kB
          Sergey Shelukhin
        11. HIVE-8225.patch
          24 kB
          Sergey Shelukhin

        Issue Links

          Activity

            People

              pxiong Pengcheng Xiong
              sershe Sergey Shelukhin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: