Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3809#discussion_r114448027
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/CodeGenerator.scala
---
@@ -274,27 +278,73 @@ class CodeGenerator(
constantFlags: Option[Array[(Int, Boolean)]],
outputArity: Int,
needRetract: Boolean,
- needMerge: Boolean)
+ needMerge: Boolean,
+ needReset: Boolean)
: GeneratedAggregationsFunction = {
// get unique function name
val funcName = newName(name)
// register UDAGGs
val aggs = aggregates.map(a => generator.addReusableFunction(a))
// get java types of accumulators
- val accTypes = aggregates.map { a =>
-
a.getClass.getMethod("createAccumulator").getReturnType.getCanonicalName
+ val accTypeClasses = aggregates.map { a =>
+ val accType = TypeExtractor.createTypeInfo(a,
classOf[AggregateFunction[_, _]], a.getClass, 1)
--- End diff --
why doesn't the original approach work anymore?
IMO, it is better to avoid the TypeExtractor if possible, esp. when trying
to extract generic types.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---