flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-3097) Add support for custom functions in Table API
Date Thu, 10 Dec 2015 16:35:11 GMT

    [ https://issues.apache.org/jira/browse/FLINK-3097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15051201#comment-15051201
] 

ASF GitHub Bot commented on FLINK-3097:
---------------------------------------

Github user aljoscha commented on the pull request:

    https://github.com/apache/flink/pull/1429#issuecomment-163680178
  
    This looks good. :+1: Can you also integrate the support for Scala, i.e. extract it from
#1237 
    
    My only concern is that it introduces yet another instance where TypeInformation is shipped
to the cluster. I think we should tackle the problem at some point. Maybe generate the code
on the client and ship the code as a string. Then use Janino to just compile it to a final
class.


> Add support for custom functions in Table API
> ---------------------------------------------
>
>                 Key: FLINK-3097
>                 URL: https://issues.apache.org/jira/browse/FLINK-3097
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API
>            Reporter: Timo Walther
>            Assignee: Timo Walther
>
> Currently, the Table API has a very limited set of built-in functions. Support for custom
functions can solve this problem. Adding of a custom row function could look like:
> {code}
> TableEnvironment tableEnv = new TableEnvironment();
> RowFunction<String> rf = new RowFunction<String>() {
>     @Override
>     public String call(Object[] args) {
>         return ((String) args[0]).trim();
>     }
> };
> tableEnv.getConfig().registerRowFunction("TRIM", rf,
>     BasicTypeInfo.STRING_TYPE_INFO);
> DataSource<Tuple1<String>> input = env.fromElements(
>     new Tuple1<>(" 1 "));
> Table table = tableEnv.fromDataSet(input);
> Table result = table.select("TRIM(f0)");
> {code}
> This feature is also necessary as part of FLINK-2099.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message