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/02/05 01:17:00 UTC

[jira] [Updated] (SPARK-28310) ANSI SQL grammar support: first_value/last_value(expression, [RESPECT NULLS | IGNORE NULLS])

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

Dongjoon Hyun updated SPARK-28310:
----------------------------------
    Fix Version/s:     (was: 3.0.0)

> ANSI SQL grammar support: first_value/last_value(expression, [RESPECT NULLS | IGNORE NULLS])
> --------------------------------------------------------------------------------------------
>
>                 Key: SPARK-28310
>                 URL: https://issues.apache.org/jira/browse/SPARK-28310
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 3.0.0
>            Reporter: Zhu, Lipeng
>            Priority: Minor
>
> According to the ANSI SQL 2011:
> {code:sql}
> <default expression> ::= <value expression>
> <null treatment> ::= RESPECT NULLS | IGNORE NULLS
> <first or last value function> ::=
> <first or last value> <left paren> <value expression> <right paren> [ <null treatment>
> ]
> <first or last value> ::=
> FIRST_VALUE | LAST_VALUE
> {code}
> Teradata - [https://docs.teradata.com/reader/756LNiPSFdY~4JcCCcR5Cw/SUwCpTupqmlBJvi2mipOaA] 
> Oracle - [https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/FIRST_VALUE.html#GUID-D454EC3F-370C-4C64-9B11-33FCB10D95EC]
> Redshift – [https://docs.aws.amazon.com/redshift/latest/dg/r_WF_first_value.html]
>  
> Postgresql didn't implement the Ignore/respect nulls. 
> [https://www.postgresql.org/docs/devel/functions-window.html]
> h3. Note
> The SQL standard defines a {{RESPECT NULLS}} or {{IGNORE NULLS}} option for {{lead}}, {{lag}}, {{first_value}}, {{last_value}}, and {{nth_value}}. This is not implemented in PostgreSQL: the behavior is always the same as the standard's default, namely {{RESPECT NULLS}}.
>   



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