[
https://issues.apache.org/jira/browse/FLINK-10958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16694378#comment-16694378
]
ASF GitHub Bot commented on FLINK-10958:
----------------------------------------
dianfu opened a new pull request #7152: [FLINK-10958] [table] Add overload
support for user defined function
URL: https://github.com/apache/flink/pull/7152
## What is the purpose of the change
*This pull request adds the overload support for user defined function.*
## Brief change log
- *add logical in UserDefinedFunctionUtil#getUserDefinedMethod which
identifies the methods which are more applicable than others when multiple
methods are applicable.*
## Verifying this change
This change added tests and can be verified as follows:
- *Added test that validates that overload take effects*
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (no)
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Add overload support for user defined function
> -----------------------------------------------
>
> Key: FLINK-10958
> URL: https://issues.apache.org/jira/browse/FLINK-10958
> Project: Flink
> Issue Type: Task
> Components: Table API & SQL
> Reporter: Dian Fu
> Assignee: Dian Fu
> Priority: Major
> Labels: pull-request-available
>
> 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
(v7.6.3#76005)