spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Herman van Hovell (JIRA)" <>
Subject [jira] [Commented] (SPARK-9740) first/last aggregate NULL behavior
Date Tue, 16 Feb 2016 11:06:18 GMT


Herman van Hovell commented on SPARK-9740:

[~emlyn] We have merged a patch for this, see:
Things like this typically don't get backported; since it is more a feature than a bug.

You could still use the sql workarround. You could also create some glue code, i.e. put the
contents of the merged PR in a different object (ExtendedFunctions?) in the org.apache.spark.sql
package. I sometimes do this when I need such functionality.

> first/last aggregate NULL behavior
> ----------------------------------
>                 Key: SPARK-9740
>                 URL:
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Herman van Hovell
>            Assignee: Yin Huai
>              Labels: releasenotes
>             Fix For: 1.6.0
> 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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message