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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.1.0
    • None
    • None
    • 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

              Unassigned Unassigned
              stakiar Sahil Takiar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: