Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2653#discussion_r90038389
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/codegen/CodeGenerator.scala
 ---
    @@ -1332,16 +1360,17 @@ class CodeGenerator(
       }
     
       /**
    -    * Adds a reusable [[UserDefinedFunction]] to the member area of the 
generated [[Function]].
    -    * The [[UserDefinedFunction]] must have a default constructor, 
however, it does not have
    +    * Adds a reusable instance (a 
[[org.apache.flink.api.table.functions.TableFunction]] or
    +    * [[org.apache.flink.api.table.functions.ScalarFunction]]) to the 
member area of the generated
    +    * [[Function]]. The instance class must have a default constructor, 
however, it does not have
         * to be public.
         *
    -    * @param function [[UserDefinedFunction]] object to be instantiated 
during runtime
    +    * @param instance object to be instantiated during runtime
         * @return member variable term
         */
    -  def addReusableFunction(function: UserDefinedFunction): String = {
    -    val classQualifier = function.getClass.getCanonicalName
    -    val fieldTerm = s"function_${classQualifier.replace('.', '$')}"
    +  def addReusableInstance(instance: Any): String = {
    --- End diff --
    
    I think it would not hurt if we keep `UserDefinedFunction` and have it as a 
superclass/superinterface of `ScalarFunction` and `TableFunction` (even without 
implementation). Better than definining `Any` at certain locations.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to