Github user twalthr commented on a diff in the pull request:
https://github.com/apache/flink/pull/2653#discussion_r88465942
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/TableEnvironment.scala
---
@@ -152,21 +153,40 @@ abstract class TableEnvironment(val config:
TableConfig) {
protected def getBuiltInRuleSet: RuleSet
/**
- * Registers a [[UserDefinedFunction]] under a unique name. Replaces
already existing
+ * Registers a [[ScalarFunction]] under a unique name. Replaces already
existing
* user-defined functions under this name.
*/
- def registerFunction(name: String, function: UserDefinedFunction): Unit
= {
- function match {
- case sf: ScalarFunction =>
- // register in Table API
- functionCatalog.registerFunction(name, function.getClass)
+ def registerFunction(name: String, function: ScalarFunction): Unit = {
+ // register in Table API
+ functionCatalog.registerFunction(name, function.getClass)
- // register in SQL API
- functionCatalog.registerSqlFunction(sf.getSqlFunction(name,
typeFactory))
+ // register in SQL API
+ functionCatalog.registerSqlFunction(function.getSqlFunction(name,
typeFactory))
--- End diff --
Yes, you are right this seems to be a bug.
---
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.
---