You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Kurt Young (Jira)" <ji...@apache.org> on 2019/12/04 04:31:00 UTC
[jira] [Updated] (FLINK-13580) Add overload support for user
defined function to blink-planner
[ https://issues.apache.org/jira/browse/FLINK-13580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kurt Young updated FLINK-13580:
-------------------------------
Fix Version/s: (was: 1.10.0)
> Add overload support for user defined function to blink-planner
> ---------------------------------------------------------------
>
> Key: FLINK-13580
> URL: https://issues.apache.org/jira/browse/FLINK-13580
> Project: Flink
> Issue Type: New Feature
> Components: Table SQL / Planner
> Reporter: Jingsong Lee
> Priority: Major
>
> Currently overload is not supported in user defined function and given the following UDF
> {code:java}
> class Func21 extends ScalarFunction {
> def eval(p: People): String = {
> p.name
> }
> def eval(p: Student): String = {
> "student#" + p.name
> }
> }
> class People(val name: String)
> class Student(name: String) extends People(name)
> class GraduatedStudent(name: String) extends Student(name)
> {code}
> Queries such as the following will compile failed with error msg "Found multiple 'eval' methods which match the signature."
>
> {code:java}
> val udf = new Func21
> val table = ...
> table.select(udf(new GraduatedStudent("test"))) {code}
> That's because overload is not supported in user defined function currently. I think it will make sense to support overload following the java language specification in section [15.2|https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.12].
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)