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