You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (Jira)" <ji...@apache.org> on 2020/04/22 16:10:00 UTC

[jira] [Resolved] (SPARK-31512) make window function using order by optional

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

Hyukjin Kwon resolved SPARK-31512.
----------------------------------
    Resolution: Duplicate

> make window function using order by optional
> --------------------------------------------
>
>                 Key: SPARK-31512
>                 URL: https://issues.apache.org/jira/browse/SPARK-31512
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.4.5
>         Environment: spark2.4.5
> hadoop2.7.7
>            Reporter: philipse
>            Priority: Minor
>
> Hi all
> In other sql dialect ,order by is not the must when using window function,we may make it pararmteterized
> the below is the case :
> *select row_number()over() from test1*
> Error: org.apache.spark.sql.AnalysisException: Window function row_number() requires window to be ordered, please add ORDER BY clause. For example SELECT row_number()(value_expr) OVER (PARTITION BY window_partition ORDER BY window_ordering) from table; (state=,code=0)
>  
> So. i suggest make it as a choice,or we will meet the error when migrate sql from other dialect,such as hive



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org