KurtYoung commented on a change in pull request #8110: [FLINK-12098] [table-planner-blink] Add support for generating optimized logical plan for simple group aggregate on stream URL: https://github.com/apache/flink/pull/8110#discussion_r271998426
########## File path: flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/plan/util/AggregateUtil.scala ########## @@ -495,4 +497,65 @@ object AggregateUtil extends Enumeration { } (aggBufferNames ++ distinctBufferNames).toArray } + + /** + * Optimize max or min with retraction agg. MaxWithRetract can be optimized to Max if input is + * update increasing. + */ + def getNeedRetractions( + groupSize: Int, + needRetraction: Boolean, + aggs: Seq[AggregateCall]): Array[Boolean] = { + + val needRetractionArray = Array.fill(aggs.size)(needRetraction) + // TODO supports RelModifiedMonotonicity + + needRetractionArray + } + + /** + * Derives output row type from local aggregate + */ + def inferLocalAggRowType( + aggInfoList: AggregateInfoList, + inputRowType: RelDataType, + groupSet: Array[Int], + typeFactory: FlinkTypeFactory): RelDataType = { + Review comment: delete blank line ---------------------------------------------------------------- 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