Frans Drijver created HIVE-4661:
-----------------------------------

             Summary: Unable to wrap analytical function in another function
                 Key: HIVE-4661
                 URL: https://issues.apache.org/jira/browse/HIVE-4661
             Project: Hive
          Issue Type: Bug
          Components: SQL
    Affects Versions: 0.11.0
            Reporter: Frans Drijver


I am unable to wrap an analytical function in another function as so:

{quote}
 select 
    case when ta_end_datetime_berekenen = 'Y' 
    then lead(ta_update_datetime) over ( partition by dn_waarde_van, 
dn_waarde_tot order by ta_update_datetime ) 
    else ea_end_datetime end as ea_end_datetime
, ta_insert_datetime
, ta_update_datetime 
from tmp_wtdh_bestedingsklasse_10_s2_stap2
{quote}

This produces the following error:

{quote}
NoViableAltException(86@[129:7: ( ( ( KW_AS )? identifier ) | ( KW_AS LPAREN 
identifier ( COMMA identifier )* RPAREN ) )?])

FAILED: ParseException line 1:175 missing KW_END at 'over' near ')' in 
selection target line 1:254 cannot recognize input near 'else' 
'ea_end_datetime' 'end' in selection target
{quote}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to