[
https://issues.apache.org/jira/browse/SPARK-18170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16196839#comment-16196839
]
Hyukjin Kwon commented on SPARK-18170:
--------------------------------------
{code}
org.apache.spark.sql.AnalysisException: cannot resolve '(RANGE BETWEEN CURRENT
ROW AND 1L FOLLOWING)' due to data type mismatch: A range window frame cannot
be used in an unordered window specification.;;
'Project [sum(id#0L) windowspecdefinition(specifiedwindowframe(RangeFrame,
currentrow$(), 1)) AS sum(id) OVER (RANGE BETWEEN CURRENT ROW AND 1
FOLLOWING)#4]
+- Range (1, 3, step=1, splits=Some(8))
{code}
Looks it throws an different message now in the current master.
> Confusing error message when using rangeBetween without specifying an
> "orderBy"
> -------------------------------------------------------------------------------
>
> Key: SPARK-18170
> URL: https://issues.apache.org/jira/browse/SPARK-18170
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Reporter: Weiluo Ren
> Priority: Minor
>
> {code}
> spark.range(1,3).select(sum('id) over Window.rangeBetween(0,1)).show
> {code}
> throws runtime exception:
> {code}
> Non-Zero range offsets are not supported for windows with multiple order
> expressions.
> {code}
> which is confusing in this case because we don't have any order expression
> here.
> How about add a check on
> {code}
> orderSpec.isEmpty
> {code}
> at
> https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/window/WindowExec.scala#L141
> and throw an exception saying "no order expressions is specified"?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]