Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
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:
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)");
This feature is also necessary as part of FLINK-2099.
Attachments
Issue Links
- links to