You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Herman van Hovell (JIRA)" <ji...@apache.org> on 2015/08/07 16:02:45 UTC

[jira] [Commented] (SPARK-9740) first/last aggregate NULL behavior

    [ https://issues.apache.org/jira/browse/SPARK-9740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14661859#comment-14661859 ] 

Herman van Hovell commented on SPARK-9740:
------------------------------------------

BTW: I encountered this while doing tests for SPARK-8641. Unfortunately it is kind of a PITA to create a proper test using an Aggregate, they do not enforce sorting, so the result of FIRST/LAST is undeterministic. 

> first/last aggregate NULL behavior
> ----------------------------------
>
>                 Key: SPARK-9740
>                 URL: https://issues.apache.org/jira/browse/SPARK-9740
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 1.6.0
>            Reporter: Herman van Hovell
>            Priority: Minor
>
> The FIRST/LAST aggregates implemented as part of the new UDAF interface, return the first or last non-null value (if any) found. This is a departure from the behavior of the old FIRST/LAST aggregates and from the FIRST_VALUE/LAST_VALUE aggregates in Hive. These would return a null value, if that happened to be the first/last value seen. SPARK-9592 tries to 'fix' this behavior for the old UDAF interface.
> Hive makes this behavior configurable, by adding a skipNulls flag. I would suggest to do the same, and make the default behavior compatible with Hive.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org