[ https://issues.apache.org/jira/browse/SPARK-30707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
jiaan.geng updated SPARK-30707: ------------------------------- Description: Lead/Lag window function throws AnalysisException without ORDER BY clause: {code:java} SELECT lead(ten, four + 1) OVER (PARTITION BY four), ten, four FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s org.apache.spark.sql.AnalysisException Window function lead(ten#x, (four#x + 1), null) requires window to be ordered, please add ORDER BY clause. For example SELECT lead(ten#x, (four#x + 1), null)(value_expr) OVER (PARTITION BY window_partition ORDER BY window_ordering) from table; {code} Maybe we need fix this issue. was: {code:java} Lead/Lag window function throws AnalysisException without ORDER BY clause: SELECT lead(ten, four + 1) OVER (PARTITION BY four), ten, four FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s org.apache.spark.sql.AnalysisException Window function lead(ten#x, (four#x + 1), null) requires window to be ordered, please add ORDER BY clause. For example SELECT lead(ten#x, (four#x + 1), null)(value_expr) OVER (PARTITION BY window_partition ORDER BY window_ordering) from table; {code} Maybe we need fix this issue. > Lead/Lag window function throws AnalysisException without ORDER BY clause > ------------------------------------------------------------------------- > > Key: SPARK-30707 > URL: https://issues.apache.org/jira/browse/SPARK-30707 > Project: Spark > Issue Type: Sub-task > Components: SQL > Affects Versions: 3.0.0 > Reporter: jiaan.geng > Priority: Major > > Lead/Lag window function throws AnalysisException without ORDER BY clause: > {code:java} > SELECT lead(ten, four + 1) OVER (PARTITION BY four), ten, four > FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s > org.apache.spark.sql.AnalysisException > Window function lead(ten#x, (four#x + 1), null) requires window to be > ordered, please add ORDER BY clause. For example SELECT lead(ten#x, (four#x + > 1), null)(value_expr) OVER (PARTITION BY window_partition ORDER BY > window_ordering) from table; > {code} > > Maybe we need fix this issue. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org