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 2016/08/15 14:22:21 UTC
[jira] [Resolved] (FLINK-3097) Add support for custom functions in
Table API
[ https://issues.apache.org/jira/browse/FLINK-3097?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Timo Walther resolved FLINK-3097.
---------------------------------
Resolution: Fixed
Fix Version/s: 1.2.0
Fixed in 90fdae452b6a03fafd4ec7827030d78ae87dbcd3.
> 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 & SQL
> Reporter: Timo Walther
> Assignee: Timo Walther
> Fix For: 1.2.0
>
>
> 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)