Rough impl of IGNORE NULLS for window functions

Lists: pgsql-hackers
From: Joe Banafato <joe(at)banafato(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Rough impl of IGNORE NULLS for window functions
Date: 2011-09-13 08:18:48
Message-ID: CAL2X8+Pd146bxzYWq+iN9WTnN5z-skHi3EgGg4nGrg7EytnjFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi all,

I wrote an implementation of last_value that ignores null values,
effectively achieving the behavior of last_value(<exp> ignore nulls).
The code is up on BitBucket [1] for the moment.  Thoughts:

* This isn't on the TODO [2].  Is anyone interested in getting this in
the language? I use this feature extensively and need it for an
Oracle port.
* I'd love to get a critique, especially on using WinSetMarkPosition.
* I have not extended the syntax (I simply called the function
last_value_ignore_nulls), and I hope to get some guidance on starting
that.

I'll be starting the other functions shortly.

Cheers,

Joe

[1] https://bitbucket.org/joeb/pg-window-ignore-nulls/src
[2] https://wiki.postgresql.org/wiki/Todo#Window_Functions


From: David Fetter <david(at)fetter(dot)org>
To: Joe Banafato <joe(at)banafato(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Rough impl of IGNORE NULLS for window functions
Date: 2011-09-13 22:17:32
Message-ID: 20110913221732.GD14038@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Sep 13, 2011 at 04:18:48AM -0400, Joe Banafato wrote:
> Hi all,
>
> I wrote an implementation of last_value that ignores null values,
> effectively achieving the behavior of last_value(<exp> ignore nulls).
> The code is up on BitBucket [1] for the moment.  Thoughts:

Just in case of lossage on bitbucket, could you please send a patch
vs. git master to the list?

Cheers,
David (pretty excited about this feature).
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate