Github user walterddr commented on a diff in the pull request: https://github.com/apache/flink/pull/5555#discussion_r183222457 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/OverAggregate.scala --- @@ -70,7 +70,12 @@ trait OverAggregate { val aggStrings = namedAggregates.map(_.getKey).map( a => s"${a.getAggregation}(${ - if (a.getArgList.size() > 0) { + val prefix = if (a.isDistinct) { --- End diff -- will address in FLINK-8690
---