[ 
https://issues.apache.org/jira/browse/HIVE-4197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13605743#comment-13605743
 ] 

Harish Butani commented on HIVE-4197:
-------------------------------------

Ashutosh, thanks for reviewing.

- agree with you on Partition/Order expressions, Boundary amount deviations 
from Standard.

- Stable order issue:
It is not just restricted to when no order is specified. It also crops up when 
2 rows have the same value on the Order expressions. This affects  the window 
frame and processing of functions that dependent on the 
order(rank,dense_rank...)
One thought is to add the FileName and FileOffset virtual columns to the Order 
Spec. 

Source Window Spec:
as I understand this, it is the ability to reference another Window definition 
in the Query and inherit components from it. For e.g.

{noformat}
select a,b, rank() over (w1 unbounded preceding and current row),
from xyz
window w1 (partition by x order by y)
{noformat}

The effective window spec for rank() is:
{noformat}
rank() over (partition by x order by y w1 unbounded preceding and current row)
{noformat}

The rule we have adopted is that each component Partition, Order, WindowFrame 
is independently inherited from a source Window Spec. Inheritance happens only 
if that component is not defined. As I said in the doc, it is not clear to me 
what the spec is mandating here.

- Agree with your other points. 
1. The way we have Range Windows is confusing. Should associate it with the 
Order expression
2. Don't see the point of allowing Windows on Lead, Lag, Rank etc.So then Jira 
4192 can be resolved as '.working as designed'
3. Lead/Lag UDFs will keep it in for now; but may remove if it becomes hard to 
maintain
                
> Bring windowing support inline with SQL Standard
> ------------------------------------------------
>
>                 Key: HIVE-4197
>                 URL: https://issues.apache.org/jira/browse/HIVE-4197
>             Project: Hive
>          Issue Type: Bug
>          Components: PTF-Windowing
>            Reporter: Harish Butani
>         Attachments: WindowingSpecification.pdf
>
>
> The current behavior defers from the Standard in several significant places.
> Please review attached doc; there are still a few open issues. Once we agree 
> on the behavior, can proceed with fixing the implementation.

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