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

pengzhiwei edited comment on CALCITE-3000 at 4/20/19 9:52 AM:
--------------------------------------------------------------

Hi [~julianhyde], the description of the issue has been updated and a PR has 
pulled.

Here is the mainly change list in this PR:
 # Add {{SqlUtil#findBestMatchMethod}} to support find best matched method in 
the function class.
 # Support dynamic type inference according to the calling argument types based 
on (1).({{SqlFunction#getReturnTypeInferenceForClass}}、 
{{SqlFunction#getOperandTypeInferenceForClass }} and 
{{SqlFunction#getOperandTypeCheckerForClass}})
 #  Add {{argTypes}} and {{typeFactory}} parameters to 
{{ImplementableFunction#getImplementor}} to create {{CallImplementor}} 
according to the argument types.
 # Add {{argTypes}} and {{typeFactory}} parameters to 
{{TableFunction#getRowType}} to infer return type according to the argument 
types.
 #  Add {{JavaScalarFunction}} and {{JavaTableFunction}} to represent the 
class-level function schema mapping a java class.


was (Author: pzw2018):
Hi [~julianhyde], the description of the issue has been updated and a PR has 
pulled.

Here is the mainly change list in this PR:
 # Add {{SqlUtil#findBestMatchMethod}} to support find best matched method in 
the function class.
 # Support dynamic type inference according to the calling argument types based 
on (1).({{SqlFunction#getReturnTypeInferenceForClass}}、 
{{SqlFunction#getOperandTypeInferenceForClass }} and 
{{SqlFunction#getOperandTypeCheckerForClass}})
 #  Add {{argTypes}} and {{typeFactory}} parameters to 
{{ImplementableFunction#getImplementor}} to create {{CallImplementor}} 
according to the argument types.
 # Add {{argTypes}} and {{typeFactory}} parameters to 
{{TableFunction#getRowType}} to infer return type according to the argument 
types.
 #  Add {{JavaScalarFunction}} and {{JavaTableFunction}} to represent the 
function schema mapping a java class.

> Improve SqlUserDefinedFunction and SqlUserDefinedTableFunction to support 
> overload method call
> ----------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-3000
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3000
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: pengzhiwei
>            Assignee: pengzhiwei
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
>  Here are  User-defined scalar function class and table function class:
>  
> {code:java}
> @UDFDescription(name = "MY_UDF", category = 
> SqlFunctionCategory.USER_DEFINED_FUNCTION)
> public static class MyUdfFunction {
>   public static String eval(String a) {
>     ...
>   }
>   public static String eval(String a, String b) {
>     ....
>   }
>   public static String eval(String a, int c) {
>     ....
>   }
> }
> {code}
> {code:java}
> @UDFDescription(name = "MY_UDTF", category = 
> SqlFunctionCategory.USER_DEFINED_TABLE_FUNCTION)
> public static class MyUdtfFunction {
>   public static MyScannableTable eval(String a) {
>     ...
>   }
>   public static MyScannableTable eval(long a) {
>     ...
>   }
>   public static MyScannableTable eval(int a) {
>     ...
>   }
> }
> {code}
> This issue wants to improve the SqlUserDefinedFunction and 
> SqlUserDefinedTableFunction to support  the overload functions in both 
> User-defined scalar function class and table function class.
>  
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to