[
https://issues.apache.org/jira/browse/FLINK-5906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995253#comment-15995253
]
ASF GitHub Bot commented on FLINK-5906:
---------------------------------------
Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3809#discussion_r114602957
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/BatchTableEnvironment.scala
---
@@ -178,4 +178,24 @@ class BatchTableEnvironment(
registerTableFunctionInternal[T](name, tf)
}
+
+ /**
+ * Registers an [[AggregateFunction]] under a unique name in the
TableEnvironment's catalog.
+ * Registered functions can be referenced in Table API and SQL queries.
+ *
+ * @param name The name under which the function is registered.
+ * @param f The AggregateFunction to register.
+ * @tparam T The type of the output value.
+ * @tparam ACC The type of aggregate accumulator.
+ */
+ def registerFunction[T, ACC](
+ name: String,
+ f: AggregateFunction[T, ACC])
+ : Unit = {
+ implicit val typeInfo: TypeInformation[T] = TypeExtractor
--- End diff --
Well, in the cases here, we are not really interested in the
TypeInformation itself but the type class. So it would not really matter if you
get Row.class from the `GenericTypeInfo` or the `RowTypeInfo`. Nonetheless, I
think it is a good idea to have this optional method. It would also be
consistent with the other user-defined functions.
> Add support to register UDAGG in Table and SQL API
> --------------------------------------------------
>
> Key: FLINK-5906
> URL: https://issues.apache.org/jira/browse/FLINK-5906
> Project: Flink
> Issue Type: Sub-task
> Components: Table API & SQL
> Reporter: Fabian Hueske
> Assignee: Shaoxuan Wang
>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)