You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/04/26 09:58:00 UTC
[jira] [Updated] (SPARK-48006) add SortOrder for window function which has no orderSpec
[ https://issues.apache.org/jira/browse/SPARK-48006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated SPARK-48006:
-----------------------------------
Labels: pull-request-available (was: )
> add SortOrder for window function which has no orderSpec
> --------------------------------------------------------
>
> Key: SPARK-48006
> URL: https://issues.apache.org/jira/browse/SPARK-48006
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 4.0.0
> Reporter: guihuawen
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.0.0
>
>
> I am doing Hive SQL to switch to Spark SQL.
>
> In Hive SQL
>
> hive> explain select *,row_number() over (partition by day) rn from testdb.zeropart_db;
> OK
> Explain
>
> In Spark SQL
> spark-sql> explain select *,row_number() over (partition by age ) rn from testdb.zeropart_db;
> plan
> == Physical Plan ==
> 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
> Time taken: 0.172 seconds, Fetched 1 row(s)
>
> For better compatibility with migration. For better compatibility with migration, new parameters are added to ensure compatibility with the same behavior as Hive SQL
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org