You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Tongwei (Jira)" <ji...@apache.org> on 2023/02/06 09:25:00 UTC

[jira] [Resolved] (SPARK-42356) Cannot resolve orderby attributes in DISTINCT

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

Tongwei resolved SPARK-42356.
-----------------------------
    Resolution: Won't Fix

> 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
>            Priority: Major
>
> query:
> {code:java}
> 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;
> {code}
> error:
> {code:java}
> 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.studentsname#1,address#2,student_id#3 parquet {code}
>  
>  



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