[
https://issues.apache.org/jira/browse/HIVE-15498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15780694#comment-15780694
]
Aihua Xu commented on HIVE-15498:
---------------------------------
Seems I was incorrect. Tried Postgres and Oracle, both default {{sum() over
(ORDER BY C)}} to {{RANGE BETWEEN UNBOUNDED PROCEEDING AND CURRENT ROW}} as
current Hive behavior.
So we just need to update the document.
> sum() over (order by c) should default the windowing spec to RangeBoundarySpec
> ------------------------------------------------------------------------------
>
> Key: HIVE-15498
> URL: https://issues.apache.org/jira/browse/HIVE-15498
> Project: Hive
> Issue Type: Bug
> Components: PTF-Windowing
> Affects Versions: 2.1.0
> Reporter: Aihua Xu
> Assignee: Aihua Xu
> Attachments: HIVE-15498.1.patch, HIVE-15498.2.patch
>
>
> Currently {{sum() over (partition by a)}} without order by is defaulted
> windowing to RangeBoundarySpec while {{sum() over (partition by a order by
> c)}} is defaulted to ValueBoundarySpec. It's not consistent and the user gets
> confused of the switch from "rows between" to "range between" by adding
> "order by c" clause.
> From the comment
> {noformat}
> /*
> * - A Window Frame that has only the /start/boundary, then it is
> interpreted as:
> BETWEEN <start boundary> AND CURRENT ROW
> * - A Window Specification with an Order Specification and no Window
> * Frame is interpreted as:
> ROW BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
> * - A Window Specification with no Order and no Window Frame is
> interpreted as:
> ROW BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING
> */
> {noformat}
> We intended to set as "row between" (RangeBoundarySpec), not "range between"
> (ValueBoundarySpec).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)