fhueske commented on a change in pull request #6521: [FLINK-5315][table] Adding
support for distinct operation for table API on DataStream
URL: https://github.com/apache/flink/pull/6521#discussion_r211234086
##########
File path:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/AggregateFunction.scala
##########
@@ -136,4 +138,12 @@ abstract class AggregateFunction[T, ACC] extends
UserDefinedFunction {
* accumulator type should be automatically inferred.
*/
def getAccumulatorType: TypeInformation[ACC] = null
+
+ /**
+ * Returns an aggregation function that requires distinct accumulator.
+ * @return distinct aggregate version of the [[AggregateFunction]].
+ */
+ private[flink] def distinct: DistinctAggregateFunction[T, ACC] =
DistinctAggregateFunction(this)
Review comment:
I think it would be better to not change the `AggregateFunction` class. I'd
rather add an implicit conversion to the `expressionDsl` which converts
`AggregateFunction` to `DistinctAggregateFunction` (see below) that has a
`distinct()` method that returns a `DistinctAgg()` expression.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services