sunjincheng121 commented on a change in pull request #8359: 
[FLINK-11051][table] Add streaming window FlatAggregate to Table API
URL: https://github.com/apache/flink/pull/8359#discussion_r283169490
 
 

 ##########
 File path: 
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/codegen/AggregationCodeGenerator.scala
 ##########
 @@ -127,6 +131,9 @@ class AggregationCodeGenerator(
   val constantTypes = constantExprs.map(_.resultType)
   val constantFields = constantExprs.map(addReusableBoxedConstant)
 
+  val isTableAggregate = aggregates.length == 1 &&
+    aggregates(0).isInstanceOf[TableAggregateFunction[_, _]]
 
 Review comment:
   I think `aggregates.length == 1` is the requirement of aggreate operator,  
and there a so many places using the 
`aggregates(0).isInstanceOf[TableAggregateFunction[_, _]]`, so I suggest add a 
util method in `UserDefinedFunctionUtils`.  such as: 
containsTableAggFunction(aggregationList: Seq[UserDefinedAggregateFunction]).  
which can be using in `isTableAggregate`. It's that make sense to you?
   
   BTW: I think that as long as the TableAggregateFunciton is included, it is 
the TableAggregate operation, so there is no need to judge the size of 
Aggregates here. The judgment of size==1 should be the check done by the logic 
level(validate step).

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


With regards,
Apache Git Services

Reply via email to