Re: Re: Proposal/design feedback needed: WITHIN GROUP (sql standard ordered set aggregate functions) - Mailing list pgsql-hackers

From Atri Sharma
Subject Re: Re: Proposal/design feedback needed: WITHIN GROUP (sql standard ordered set aggregate functions)
Date
Msg-id CAOeZVifC_rmft_McHkTSH3tmhruvA6FEfLakoUi2uQyGyA3Ojg@mail.gmail.com
Whole thread Raw
In response to Re: Re: Proposal/design feedback needed: WITHIN GROUP (sql standard ordered set aggregate functions)  (Atri Sharma <atri.jiit@gmail.com>)
Responses Re: Re: Proposal/design feedback needed: WITHIN GROUP (sql standard ordered set aggregate functions)
List pgsql-hackers
On Wed, Sep 4, 2013 at 10:01 PM, Atri Sharma <atri.jiit@gmail.com> wrote:
>
>
> Sent from my iPad
>
> On 04-Sep-2013, at 21:38, Peter Eisentraut <peter_e@gmx.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

pgsql-hackers by date:

Previous
From: "MauMau"
Date:
Subject: Re: 9.4 HEAD: select() failed in postmaster
Next
From: Robert Haas
Date:
Subject: Re: Protocol forced to V2 in low-memory conditions?