You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "sunjincheng (JIRA)" <ji...@apache.org> on 2017/03/06 05:28:32 UTC

[jira] [Commented] (FLINK-5957) Remove `getAccumulatorType` method from build-in `AggregateFunction`

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

sunjincheng commented on FLINK-5957:
------------------------------------

Hi, [~fhueske], I have two ideas here:
First of all:

In fact I do not like to use generics in build-in Accumulator, such as:
{code}
Class SumAccumulator [T] extends JTuple2 [T, Boolean] with Accumulator
{code}
I think we should remove these generic definitions.

Secondly:
We can define the Accumulator of the build-in aggregateFunction as a POJO type, which is more concise.

IMO. If I did the above two points, build-in the aggregateFunction we do not have to provide [[getAccumulatorType]] method, TypeInformation.of () works well.

The build-in aggregateFunction is an example of a user-defined aggregateFunction, so the implementation of the build-in aggregateFunction directly affects the user's implementation.

So, IMO. I suggest to do above changes. What do you think ?
Best,
SunJincheng

> Remove  `getAccumulatorType` method from build-in `AggregateFunction`
> ---------------------------------------------------------------------
>
>                 Key: FLINK-5957
>                 URL: https://issues.apache.org/jira/browse/FLINK-5957
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API & SQL
>            Reporter: sunjincheng
>            Assignee: sunjincheng
>
> Build-in aggregateFunction need not implement the  `getAccumulatorType` method. 
> We can get TypeInformation by  `TypeInformation.of() ` or `TypeInformation.of(new TypeHint[AGG.type](){})`. 
> What do you think? [~fhueske] [~shaoxuan] 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)