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

    https://github.com/apache/flink/pull/3176#discussion_r100470762
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/functions/UserDefinedFunction.scala
 ---
    @@ -24,4 +24,19 @@ package org.apache.flink.table.functions
       * User-defined functions must have a default constructor and must be 
instantiable during runtime.
       */
     trait UserDefinedFunction {
    --- End diff --
    
    Copy from the blog you link:
    >To summarize: If you’re writing a Scala API that will be used by Java 
clients, don’t expose traits that have implemented behavior in your public 
API. If you have traits like that, wrap them in a class for your Java consumers.
    
    The wrapper class mentioned in the blog is a concrete class defined in 
Scala and not an abstract class (like `ScalarFunction`). And if we extend this 
class in Java, the same error will be thrown. I think define 
`UserDefinedFunction` as abstract can easily fix this problem and no side 
effects. 


---
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.
---

Reply via email to