Tongwei created SPARK-42356: ------------------------------- Summary: Cannot resolve orderby attributes in DISTINCT Key: SPARK-42356 URL: https://issues.apache.org/jira/browse/SPARK-42356 Project: Spark Issue Type: Bug Components: SQL Affects Versions: 3.3.1 Reporter: Tongwei
``` CREATE TABLE students (name VARCHAR(64), address VARCHAR(64)) USING PARQUET PARTITIONED BY (student_id INT); SELECT DISTINCT trim(name) AS new_name FROM students order by name desc; ``` ERROR: ``` spark-sql> SELECT DISTINCT trim(name) AS new_name FROM students order by name desc; Error in query: Column 'name' does not exist. Did you mean one of the following? [new_name]; line 1 pos 62; 'Sort ['name DESC NULLS LAST], true +- Distinct +- Project [trim(name#1, None) AS new_name#0] +- SubqueryAlias spark_catalog.default.students +- Relation default.students[name#1,address#2,student_id#3] parquet ``` -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org