Re: Re: Proposal/design feedback needed: WITHIN GROUP (sql standard ordered set aggregate functions)

From: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Noah Misch <noah(at)leadboat(dot)com>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>
Subject: Re: Re: Proposal/design feedback needed: WITHIN GROUP (sql standard ordered set aggregate functions)
Date: 2013-09-13 09:26:43
Message-ID: CAOeZVifC_rmft_McHkTSH3tmhruvA6FEfLakoUi2uQyGyA3Ojg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 4, 2013 at 10:01 PM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
>
>
> Sent from my iPad
>
> On 04-Sep-2013, at 21:38, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>
>> On 7/19/13 11:59 AM, Atri Sharma wrote:
>>> Hi all,
>>>
>>> This is our current work-in-progress patch for WITHIN GROUP.
>>
>> This patch needs to be rebased.

Hi All,

This is our complete patch for implementation of WITHIN GROUP.

Functions supported:

percentile_disc
percentile_cont for float8 and intervals
percentile_disc and percentile_cont support arrays of percentiles as well.
mode
rank
dense_rank
percent_rank
cume_dist

The patch also adds support for user defined ordered set functions
with CREATE AGGREGATE.

Polymorphism is now supported, with the original gripes about it now
solved. Essentially, we have added
a new field in pg_aggregate, aggordnargs, which we use it to verify,
having looked up the function, that it is being called correctly.
aggordnargs holds the number of direct args to the aggregate.

Hypothetical set functions build over the extension of VARIADIC, and
all of the hypothetical set functions
have variadic 'any' as their parameter types.

Need review:

1) psql /df and /dfa output.
2) Handling of non hypothetical collations.
3) Need of mode(), and the name.

Feedback/Comments?

Regards,

Atri

Attachment Content-Type Size
withingrouppatchcontextv1.patch application/octet-stream 270.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-09-13 12:02:30 Re: Protocol forced to V2 in low-memory conditions?
Previous Message MauMau 2013-09-13 08:00:58 Re: 9.4 HEAD: select() failed in postmaster