You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Fabian Hueske (JIRA)" <ji...@apache.org> on 2017/07/11 08:02:00 UTC

[jira] [Comment Edited] (FLINK-7145) Flink SQL API should support multiple parameters for UserDefinedAggFunction

    [ https://issues.apache.org/jira/browse/FLINK-7145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16081837#comment-16081837 ] 

Fabian Hueske edited comment on FLINK-7145 at 7/11/17 8:01 AM:
---------------------------------------------------------------

This should already be supported. 
For example the following query can be executed on the current master:

{code}
SELECT TUMBLE_END(rowtime, INTERVAL '10' MINUTE), top10(cnt, page) AS topPages
FROM pageVisits 
GROUP BY TUMBLE(rowtime, INTERVAL '10' MINUTE);
{code}

{{top10}} is a UDAGG with two parameters, a count and a pageURL, and returns an array of {{Tuple2<count, page>}} for the pages with the highest counts.

[~yuemeng], please double check if this issue is valid and close it if it is already resolved.
Thanks, Fabian


was (Author: fhueske):
This should already be supported. 
For example the following query can be executed on the current master:

{code}
SELECT TUMBLE_END(rowtime, INTERVAL '10' MINUTE), top10(cnt, page) AS topPages
FROM pageVisits 
GROUP BY TUMBLE(rowtime, INTERVAL '10' MINUTE);
{code}

{{top10}} is a UDAGG with two parameters, a count and a pageURL, and returns an array of {{Tuple2<count, page>}} for the pages with the highest counts.

> Flink SQL API should support multiple parameters for UserDefinedAggFunction
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-7145
>                 URL: https://issues.apache.org/jira/browse/FLINK-7145
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: yuemeng
>            Priority: Critical
>
> UDAF such as topK and some other udaf with bloom filter need more than one parameters ,we should make flink sql support this.
> base on flink sql support DML and multiple parameters udaf,we can execute sql like:
> {code}
> CREATE TEMPORARY function 'TOPK' AS 'com.xxxx.aggregate.udaf.distinctUdaf.topk.ITopKUDAF';
> INSERT INTO db_sink SELECT id, TOPK(price, 5, 'DESC') FROM kafka_source GROUP BY id;
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)