[jira] [Created] (HIVE-4661) Unable to wrap analytical function in another function

2013-06-05 Thread Frans Drijver (JIRA)
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


[jira] [Created] (HIVE-4662) first_value can't have more than one order by column

2013-06-05 Thread Frans Drijver (JIRA)
Frans Drijver created HIVE-4662:
---

 Summary: first_value can't have more than one order by column
 Key: HIVE-4662
 URL: https://issues.apache.org/jira/browse/HIVE-4662
 Project: Hive
  Issue Type: Bug
  Components: SQL
Affects Versions: 0.11.0
Reporter: Frans Drijver


In the current implementation of the first_value function, it's not allowed to 
have more than one (1) order by column, as so:

{quote}
select distinct 
first_value(kastr.DEWNKNR) over ( partition by kastr.DEKTRNR order by 
kastr.DETRADT, rettr.DEVPDNR )
from RTAVP_DRKASTR kastr
;
{quote}

Error given:

{quote}
FAILED: SemanticException Range based Window Frame can have only 1 Sort Key
{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


[jira] [Updated] (HIVE-4662) first_value can't have more than one order by column

2013-06-05 Thread Frans Drijver (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-4662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Frans Drijver updated HIVE-4662:


Description: 
In the current implementation of the first_value function, it's not allowed to 
have more than one (1) order by column, as so:

{quote}
select distinct 
first_value(kastr.DEWNKNR) over ( partition by kastr.DEKTRNR order by 
kastr.DETRADT, kastr.DEVPDNR )
from RTAVP_DRKASTR kastr
;
{quote}

Error given:

{quote}
FAILED: SemanticException Range based Window Frame can have only 1 Sort Key
{quote}

  was:
In the current implementation of the first_value function, it's not allowed to 
have more than one (1) order by column, as so:

{quote}
select distinct 
first_value(kastr.DEWNKNR) over ( partition by kastr.DEKTRNR order by 
kastr.DETRADT, rettr.DEVPDNR )
from RTAVP_DRKASTR kastr
;
{quote}

Error given:

{quote}
FAILED: SemanticException Range based Window Frame can have only 1 Sort Key
{quote}


 first_value can't have more than one order by column
 

 Key: HIVE-4662
 URL: https://issues.apache.org/jira/browse/HIVE-4662
 Project: Hive
  Issue Type: Bug
  Components: SQL
Affects Versions: 0.11.0
Reporter: Frans Drijver

 In the current implementation of the first_value function, it's not allowed 
 to have more than one (1) order by column, as so:
 {quote}
 select distinct 
 first_value(kastr.DEWNKNR) over ( partition by kastr.DEKTRNR order by 
 kastr.DETRADT, kastr.DEVPDNR )
 from RTAVP_DRKASTR kastr
 ;
 {quote}
 Error given:
 {quote}
 FAILED: SemanticException Range based Window Frame can have only 1 Sort Key
 {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


[jira] [Created] (HIVE-4663) Needlessly adding analytical windowing columns to my select

2013-06-05 Thread Frans Drijver (JIRA)
Frans Drijver created HIVE-4663:
---

 Summary: Needlessly adding analytical windowing columns to my 
select
 Key: HIVE-4663
 URL: https://issues.apache.org/jira/browse/HIVE-4663
 Project: Hive
  Issue Type: Bug
  Components: SQL
Affects Versions: 0.11.0
Reporter: Frans Drijver


Forgive the rather cryptic title, but I was unsure what the best summary would 
be. The situation is as follows:

If I have query in which I do both a select of a 'normal' column and an 
analytical function, as so:

{quote}
select distinct 
kastr.DELOGCE
, lag(kastr.DEWNKNR) over ( partition by kastr.DEKTRNR order by kastr.DETRADT, 
kastr.DEVPDNR )
from RTAVP_DRKASTR kastr
;
{quote}

I get the following error:

{quote}
FAILED: SemanticException Failed to breakup Windowing invocations into Groups. 
At least 1 group must only depend on input columns. Also check for circular 
dependencies.
Underlying error: org.apache.hadoop.hive.ql.parse.SemanticException: Line 3:41 
Expression not in GROUP BY key 'DEKTRNR'
{quote}

The way around is to also put the analytical windowing columns in my select, as 
such:

{quote}
select distinct 
kastr.DELOGCE
, lag(kastr.DEWNKNR) over ( partition by kastr.DEKTRNR order by kastr.DETRADT, 
kastr.DEVPDNR )
, kastr.DEKTRNR
, kastr.DEWNKNR
, kastr.DETRADT
, kastr.DEVPDNR
from RTAVP_DRKASTR kastr
;
{quote}

Obviously this is generally unwanted behaviour, as it can widen the select 
significantly

--
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