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

ASF GitHub Bot commented on FLINK-6388:
---------------------------------------

Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3783#discussion_r124033513
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/CodeGenerator.scala
 ---
    @@ -335,15 +371,30 @@ class CodeGenerator(
             j"""
                 |  public final void accumulate(
                 |    org.apache.flink.types.Row accs,
    -            |    org.apache.flink.types.Row input)""".stripMargin
    +            |    org.apache.flink.types.Row input) throws 
Exception""".stripMargin
     
    +      val distAggsFlags: Array[Boolean] = distinctAggsFlags.getOrElse(new 
Array[Boolean](0))    
           val accumulate: String = {
             for (i <- aggs.indices) yield
    -          j"""
    -             |    ${aggs(i)}.accumulate(
    -             |      ((${accTypes(i)}) accs.getField($i)),
    -             |      ${parameters(i)});""".stripMargin
    -      }.mkString("\n")
    +          if (distinctAggsFlags.isDefined && distAggsFlags(i)){
    +            j"""
    +               |  Long distValCount$i = (Long) 
distStateList[$i].get(${parameters(i)});
    --- End diff --
    
    We need to put the parameters into a tuple before accessing the map state. 
The tuple should be reused.


> Add support for DISTINCT into Code Generated Aggregations
> ---------------------------------------------------------
>
>                 Key: FLINK-6388
>                 URL: https://issues.apache.org/jira/browse/FLINK-6388
>             Project: Flink
>          Issue Type: Sub-task
>          Components: DataStream API
>    Affects Versions: 1.3.0
>            Reporter: Stefano Bortoli
>            Assignee: Stefano Bortoli
>             Fix For: 1.4.0
>
>
> We should support DISTINCT in Code Generated aggrgation functions.



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

Reply via email to