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

Hive outer queries is not picking up the right column from subqueries

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.0
    • Fix Version/s: 2.0.1
    • Component/s: None
    • Labels:
      None

      Description

      The following queries show the bug:

      Setup:

      create table test (a int);
      insert into test values (7);
      

      Produces Wrong Results:

      select * from (select a-1 as a from test where a=7) z;
      
      +------+--+
      | z.a  |
      +------+--+
      | 7    |
      +------+--+
      

      Produces Correct Results:

      select * from (select a-1 as a1 from test where a=7) z;
      
      +-------+--+
      | z.a1  |
      +-------+--+
      | 6     |
      +-------+--+
      

      Note this only happens with subqueries, as the following query returns the correct value of 6 select a-1 as a from test where a=7

      This affects version 1.1.0 but has been fixed in version 2.1.0 by HIVE-13602

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                stakiar Sahil Takiar
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: