You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (Jira)" <ji...@apache.org> on 2020/03/17 08:30:00 UTC

[jira] [Resolved] (SPARK-30335) Clarify behavior of FIRST and LAST without OVER caluse.

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

Dongjoon Hyun resolved SPARK-30335.
-----------------------------------
    Fix Version/s: 3.1.0
         Assignee: Hyukjin Kwon
       Resolution: Fixed

This is resolved via https://github.com/apache/spark/pull/27099

> Clarify behavior of FIRST and LAST without OVER caluse.
> -------------------------------------------------------
>
>                 Key: SPARK-30335
>                 URL: https://issues.apache.org/jira/browse/SPARK-30335
>             Project: Spark
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 2.4.0, 3.0.0
>            Reporter: xqods9o5ekm3
>            Assignee: Hyukjin Kwon
>            Priority: Major
>             Fix For: 3.1.0
>
>
> Unlike many databases, Spark SQL allows usage of {{FIRST}} and {{LAST}} in non-analytic contexts.
>  
> At the moment {{FIRST}}
>  
> > first(expr[, isIgnoreNull]) - Returns the first value of {{expr}} for a group of rows. If {{isIgnoreNull}} is true, returns only non-null values.
>  
> and {{LAST}}
>  
> > last(expr[, isIgnoreNull]) - Returns the last value of {{expr}} for a group of rows. If {{isIgnoreNull}} is true, returns only non-null values.
>  
> descriptions, suggest that their behavior is deterministic and many users assume that it return specific values for example when query 
>  
> {code:sql}
> SELECT first(foo)
> FROM (
>     SELECT * FROM table ORDER BY bar
> )
> {code}
> That however doesn't seem to be the case.
> To make situation worse, it seems to work (for example on small samples in local mode).



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