flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-7208) Refactor build-in agg(MaxWithRetractAccumulator and MinWithRetractAccumulator) using the DataView
Date Wed, 05 Dec 2018 06:44:00 GMT

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

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

dianfu commented on a change in pull request #7201: [FLINK-7208] [table] Optimize Min/MaxWithRetractAggFunction
with DataView
URL: https://github.com/apache/flink/pull/7201#discussion_r238940699
 
 

 ##########
 File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala
 ##########
 @@ -1437,36 +1437,30 @@ object AggregateUtil {
 
           case collect: SqlAggFunction if collect.getKind == SqlKind.COLLECT =>
             aggregates(index) = new CollectAggFunction(FlinkTypeFactory.toTypeInfo(relDataType))
-            accTypes(index) = aggregates(index).getAccumulatorType
 
           case udagg: AggSqlFunction =>
             aggregates(index) = udagg.getFunction
-            accTypes(index) = udagg.accType
 
           case unSupported: SqlAggFunction =>
             throw new TableException(s"Unsupported Function: '${unSupported.getName}'")
         }
       }
+      accTypes(index) = getAccumulatorTypeOfAggregateFunction(aggregates(index))
     }
 
     val accSpecs = new Array[Seq[DataViewSpec[_]]](aggregateCalls.size)
 
     // create accumulator type information for every aggregate function
     aggregates.zipWithIndex.foreach { case (agg, index) =>
 
 Review comment:
   Without this change, we need to add `accTypes(index) = aggregates(index).getAccumulatorType`
for every built-in agg which uses `DataView` in the future. I think this change makes the
logic more simple and clear.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Refactor build-in agg(MaxWithRetractAccumulator and MinWithRetractAccumulator) using
the DataView
> -------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-7208
>                 URL: https://issues.apache.org/jira/browse/FLINK-7208
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Table API &amp; SQL
>            Reporter: kaibo.zhou
>            Assignee: Dian Fu
>            Priority: Major
>              Labels: pull-request-available
>
> Refactor build-in agg(MaxWithRetractAccumulator and MinWithRetractAccumulator) using
the DataView.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message