You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Timo Walther (JIRA)" <ji...@apache.org> on 2017/02/20 14:41:44 UTC

[jira] [Resolved] (FLINK-5571) add open and close methods for UserDefinedFunction in TableAPI & SQL

     [ https://issues.apache.org/jira/browse/FLINK-5571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timo Walther resolved FLINK-5571.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 1.3.0

Fixed in 1.3.0: b820fd3ca038e411bc7f43e1c35637bf62981fe5

> add open and close methods for UserDefinedFunction in TableAPI & SQL
> --------------------------------------------------------------------
>
>                 Key: FLINK-5571
>                 URL: https://issues.apache.org/jira/browse/FLINK-5571
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: godfrey he
>            Assignee: godfrey he
>             Fix For: 1.3.0
>
>
> Currently, a User Defined Function (UDF) in table API & SQL works on zero, one, or multiple values in custom evaluation method. Many UDFs need more complex features, e.g. report metrics, get parameters from job configuration, or get extra data from distribute cache file, etc. Adding open and close methods in UserDefinedFunction class can solve this problem. The code cloud look like:
> {code}
> trait UserDefinedFunction {
>   def open(context: UDFContext): Unit = {}
>   def close(): Unit = {}
> }
> {code}
> UDFContext contains the information about metric reporters, job parameters, distribute cache, etc. The code cloud look like:
> {code}
> class UDFContext(context: RuntimeContext) {
>   def getMetricGroup: MetricGroup = ???
>   def getDistributedCacheFile(name: String): File = ???
>   def getJobParameter(key: String, default: String): String = ???
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)