Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/4873#discussion_r147096750
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/utils/AggSqlFunction.scala
---
@@ -58,14 +62,17 @@ class AggSqlFunction(
// will be generated when translating the calcite relnode to flink
runtime execution plan
null,
false,
- requiresOver
+ requiresOver,
+ typeFactory
) {
def getFunction: AggregateFunction[_, _] = aggregateFunction
override def isDeterministic: Boolean = aggregateFunction.isDeterministic
override def toString: String = displayName
+
+ override def getParamTypes: util.List[RelDataType] =
Collections.emptyList()
--- End diff --
I checked the Calcite code. There is a method that accesses the first
element of the list if it is not `null` (no length >= 1 check). Hence, an empty
list would result in an exception. I'd rather return `null` here.
---