Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
2.4.5
-
None
-
None
-
spark2.4.5
hadoop2.7.7
Description
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
Attachments
Issue Links
- duplicates
-
SPARK-30707 Lead/Lag window function throws AnalysisException without ORDER BY clause
-
- In Progress
-
- links to