I believer that PERCENTILE_DISC was implemented in 
https://issues.apache.org/jira/browse/CALCITE-4644 
<https://issues.apache.org/jira/browse/CALCITE-4644>. There are open issues to 
support any sortable type [ https://issues.apache.org/jira/browse/CALCITE-4670 
<https://issues.apache.org/jira/browse/CALCITE-4670> ] and also to change the 
implementation strategy [ https://issues.apache.org/jira/browse/CALCITE-4666 
<https://issues.apache.org/jira/browse/CALCITE-4666> ].

Does your case map onto any of those?

Is PERCENTILE_DISC able to deduce return types from its arguments today? If so, 
how does it do it?

Julian


> On Aug 3, 2022, at 1:40 PM, Itiel Sadeh <iti...@sqreamtech.com.INVALID> wrote:
> 
> Hello,
> 
> First of all I just wanted to thank all of you for the work you are doing
> on Calcite.
> 
> We want to add support for the percentile_disc aggregate function, but we
> encounter a problem.
> Our percentile_disc return type is dependent on the column of the "order
> by" clause (just like postgresql
> <https://www.postgresql.org/docs/current/functions-aggregate.html>).
> However, I don't see how to achieve that on calcite. The issue is that the
> sort column argument is not passed to the percentile_disc function, Rather,
> it is stored outside of it as a collation. Therefore, I cannot use the
> SqlReturnTypeInference mechanism.
> 
> If someone has an idea on how to achieve this it would be very much
> appreciated.
> Thank you,
> 
> Itiel

Reply via email to