You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Takeshi Yamamuro (Jira)" <ji...@apache.org> on 2019/12/29 07:09:00 UTC

[jira] [Resolved] (SPARK-28385) SELECT DISTINCT ON ( expression [, ...] ) syntax

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

Takeshi Yamamuro resolved SPARK-28385.
--------------------------------------
    Resolution: Won't Fix

> SELECT DISTINCT ON ( expression [, ...] ) syntax
> ------------------------------------------------
>
>                 Key: SPARK-28385
>                 URL: https://issues.apache.org/jira/browse/SPARK-28385
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Yuming Wang
>            Priority: Major
>
> {{SELECT DISTINCT ON ( _{{expression}}_ [, ...] )}} keeps only the first row of each set of rows where the given expressions evaluate to equal. The {{DISTINCT ON}} expressions are interpreted using the same rules as for {{ORDER BY}} (see above). Note that the “first row” of each set is unpredictable unless {{ORDER BY}} is used to ensure that the desired row appears first. For example:
> {code:sql}
> SELECT DISTINCT ON (location) location, time, report
>     FROM weather_reports
>     ORDER BY location, time DESC;
> {code}
> https://www.postgresql.org/docs/11/sql-select.html



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