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

HiveProjectJoinTransposeRule may do invalid transformations with windowing expressions

    XMLWordPrintableJSON

Details

    Description

      running

      create table table1 (acct_num string, interest_rate decimal(10,7)) stored as orc;
      create table table2 (act_id string) stored as orc;
      CREATE TABLE temp_output AS
      SELECT act_nbr, row_num
      FROM (SELECT t2.act_id as act_nbr,
      row_number() over (PARTITION BY trim(acct_num) ORDER BY interest_rate DESC) AS row_num
      FROM table1 t1
      INNER JOIN table2 t2
      ON trim(acct_num) = t2.act_id) t
      WHERE t.row_num = 1;
      

      may result in error like:

      Error: Error while compiling statement: FAILED: SemanticException Line 0:-1 Invalid column reference 'interest_rate': (possible column names are: interest_rate, trim) (state=42000,code=40000)
      

      Attachments

        Issue Links

          Activity

            People

              kgyrtkirk Zoltan Haindrich
              kgyrtkirk Zoltan Haindrich
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m