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

Wenchen Fan resolved SPARK-36637.
---------------------------------
    Fix Version/s: 3.2.0
       Resolution: Fixed

Issue resolved by pull request 33892
[https://github.com/apache/spark/pull/33892]

> Bad error message when using non-existing named window
> ------------------------------------------------------
>
>                 Key: SPARK-36637
>                 URL: https://issues.apache.org/jira/browse/SPARK-36637
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.3.0
>            Reporter: Wenchen Fan
>            Priority: Major
>             Fix For: 3.2.0
>
>
> {code:java}
> CREATE TABLE employees 
> (name STRING, dept STRING, salary INT, age INT);
> SELECT AVG(age) OVER win AS salary, 
> AVG(salary) OVER win AS avgsalary,
> MIN(salary) OVER win AS minsalary,
> MAX(salary) OVER win AS maxsalary,
> COUNT(1) OVER win AS numEmps
> FROM employees;
> Error in query: unresolved operator 'Aggregate 
> [unresolvedwindowexpression(avg(age#43), WindowSpecReference(win)) AS 
> salary#34, unresolvedwindowexpression(avg(salary#42), 
> WindowSpecReference(win)) AS avgsalary#35, 
> unresolvedwindowexpression(min(salary#42), WindowSpecReference(win)) AS 
> minsalary#36, unresolvedwindowexpression(max(salary#42), 
> WindowSpecReference(win)) AS maxsalary#37, 
> unresolvedwindowexpression(count(1), WindowSpecReference(win)) AS numEmps#38];
> 'Aggregate [unresolvedwindowexpression(avg(age#43), WindowSpecReference(win)) 
> AS salary#34, unresolvedwindowexpression(avg(salary#42), 
> WindowSpecReference(win)) AS avgsalary#35, 
> unresolvedwindowexpression(min(salary#42), WindowSpecReference(win)) AS 
> minsalary#36, unresolvedwindowexpression(max(salary#42), 
> WindowSpecReference(win)) AS maxsalary#37, 
> unresolvedwindowexpression(count(1), WindowSpecReference(win)) AS numEmps#38]
> +- SubqueryAlias spark_catalog.default.employees
> +- HiveTableRelation [`default`.`employees`, 
> org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, Data Cols: [name#40, 
> dept#41, salary#42, age#43], Partition Cols: []]
> {code}



--
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

Reply via email to