Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/5241#discussion_r160268630 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala --- @@ -1130,259 +1134,263 @@ object AggregateUtil { // create aggregate function instances by function type and aggregate field data type. aggregateCalls.zipWithIndex.foreach { case (aggregateCall, index) => val argList: util.List[Integer] = aggregateCall.getArgList - if (argList.isEmpty) { - if (aggregateCall.getAggregation.isInstanceOf[SqlCountAggFunction]) { - aggFieldIndexes(index) = Array[Int](0) - } else { - throw new TableException("Aggregate fields should not be empty.") + + if (aggregateCall.getAggregation.isInstanceOf[SqlCountAggFunction]) { + aggregates(index) = new CountAggFunction() + if(argList.isEmpty) { --- End diff -- add space
---