You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Josh Mahonin (Jira)" <ji...@apache.org> on 2022/07/28 15:53:00 UTC
[jira] [Created] (FLINK-28736) Add APPROX_PERCENTILE function
Josh Mahonin created FLINK-28736:
------------------------------------
Summary: Add APPROX_PERCENTILE function
Key: FLINK-28736
URL: https://issues.apache.org/jira/browse/FLINK-28736
Project: Flink
Issue Type: Improvement
Affects Versions: 1.15.1
Reporter: Josh Mahonin
We have an {{APPROX_PERCENTILE}} UDF that we believe may be useful to the broader community. It's a rather simple implementation that wraps TDigest to return approximate quantile/percentile data in both batch and streaming mode.
I'm somewhat torn as to how to properly contribute this. Following Calcite conventions, I believe this would qualify as an {{APPROXIMATE PERCENTILE_DISC}} function, although that would require Calcite >= 1.28 (FLINK-21239, FLINK-27998).
Alternatively, perhaps this could simply be dropped in as a new function that's not backed by Calcite, although it's not immediately clear to me how to proceed with that, though I'm happy to take guidance here.
This is a gist of the implementation:
https://gist.github.com/jmahonin/d75150999af30bc78bdf00c7b0ecbd4f
--
This message was sent by Atlassian Jira
(v8.20.10#820010)