[
https://issues.apache.org/jira/browse/HIVE-4394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13639139#comment-13639139
]
Harish Butani commented on HIVE-4394:
-------------------------------------
If I try this in pg:
{noformat}
select p_mfgr,p_name, p_size,
sum(p_size - lag(p_size,1) over(partition by p_mfgr order by p_name) )
over(partition by p_mfgr order by p_name ) as deltaSum
from part
window w1 as (rows between 2 preceding and 2 following)
{noformat}
it gives ERROR: window function calls cannot be nested
If I try this
{noformat}
select p_mfgr,p_name, p_size,
sum(p_size) over(partition by p_mfgr order by p_name ) - lag(p_size,1)
over(partition by p_mfgr order by p_name ) as deltaSum
from part
window w1 as (rows between 2 preceding and 2 following)
{noformat}
the first Mfr2 row has a null for delatSum.
What was the query that gives 0?
Null seems like the right answer to me.
> test leadlag.q fails
> --------------------
>
> Key: HIVE-4394
> URL: https://issues.apache.org/jira/browse/HIVE-4394
> Project: Hive
> Issue Type: Bug
> Components: PTF-Windowing
> Reporter: Namit Jain
>
> ant test -Dtestcase=TestCliDriver -Dqfile=leadlag.q fails.
> cc [~rhbutani]
--
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