You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Wenchen Fan (Jira)" <ji...@apache.org> on 2021/09/01 08:45:00 UTC

[jira] [Created] (SPARK-36637) Bad error message when using non-existing named window

Wenchen Fan created SPARK-36637:
-----------------------------------

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


{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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org