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

Hive: Query misaligned result for Group by followed by Join with filter and skip a group-by result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.10.0
    • Query Processor
    • None
    • Reviewed

    Description

      This simple Hive query would generate wrong result:

      select a.key, b.k2, b.k3
      from src a
      join (
      select key,
      min(key) as k,
      min(key)+1 as k1,
      min(key)+2 as k2,
      min(key)+3 as k3
      from src
      group by key
      ) b
      on a.key=b.key and b.k1 < 5;

      0 3.0 1.0
      0 3.0 1.0
      0 3.0 1.0
      2 5.0 3.0

      The right result is:
      0 2.0 3.0
      0 2.0 3.0
      0 2.0 3.0
      2 4.0 5.0

      Attachments

        1. hive-3343.patch
          48 kB
          Gang Tim Liu

        Activity

          People

            gangtimliu Gang Tim Liu
            gangtimliu Gang Tim Liu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: