[
https://issues.apache.org/jira/browse/FLINK-9294?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rong Rong updated FLINK-9294:
-----------------------------
Description:
Most of the UDF function signatures that includes composite types such as
*{{MAP}}*, *{{ARRAY}}*, etc would require user to override
*{{getParameterType}}* or *{{getResultType}}* method explicitly.
It should be able to resolve the composite type based on the function
signature, such as:
{code:java}
public String[] eval(Map<String, Integer> mapArg) { /* ... */ }
{code}
The function catalog search should do either of the following:
[Update] since we have backward compatibility issue with resolving to a
different type, we will not go with the modify type option.
- -Automatically resolve that:-
-1. *{{ObjectArrayTypeInfo<BasicTypeInfo.STRING>}}* to be the result type.-
-2. *{{MapTypeInfo<BasicTypeInfo.STRING, BasicTypeInfo.INTEGER>}}* to be the
parameter type.-
- Improved function mapping to find and locate function with such signatures
** Change the following method to relax the
check:*UserDefinedFunctionUtils.{{*getUserDefinedMethod*}}*
** *{{UserDefinedFunctionUtils.}}{{getEvalMethodSignature}}*
-
During compilation, should do the following:
- Consistent resolution for: (Scala.Map / java.util.Map) and (Scala.Seq / Java
array)
- Automatically ingest type cast function (see FLINK-9430) to match the
correct type, or automatically generate the counter part of the corresponding
Scala / Java implementation of the eval function.
was:
Most of the UDF function signatures that includes composite types such as
*{{MAP}}*, *{{ARRAY}}*, etc would require user to override
*{{getParameterType}}* or *{{getResultType}}* method explicitly.
It should be able to resolve the composite type based on the function
signature, such as:
{code:java}
public String[] eval(Map<String, Integer> mapArg) { /* ... */ }
{code}
The function catalog search should do either of the following:
- Automatically resolve that:
1. *{{ObjectArrayTypeInfo<BasicTypeInfo.STRING>}}* to be the result type.
2. *{{MapTypeInfo<BasicTypeInfo.STRING, BasicTypeInfo.INTEGER>}}* to be the
parameter type.
- Improved function mapping to find and locate function with such signatures.
During compilation, should do the following:
- Consistent resolution for: (Scala.Map / java.util.Map) and (Scala.Seq / Java
array)
- Automatically ingest type cast function (see FLINK-9430) to match the
correct type, or automatically generate the counter part of the corresponding
Scala / Java implementation of the eval function.
> Improve type inference for UDFs with composite parameter or result type
> ------------------------------------------------------------------------
>
> Key: FLINK-9294
> URL: https://issues.apache.org/jira/browse/FLINK-9294
> Project: Flink
> Issue Type: Sub-task
> Components: Table API & SQL
> Reporter: Rong Rong
> Assignee: Rong Rong
> Priority: Major
>
> Most of the UDF function signatures that includes composite types such as
> *{{MAP}}*, *{{ARRAY}}*, etc would require user to override
> *{{getParameterType}}* or *{{getResultType}}* method explicitly.
> It should be able to resolve the composite type based on the function
> signature, such as:
> {code:java}
> public String[] eval(Map<String, Integer> mapArg) { /* ... */ }
> {code}
> The function catalog search should do either of the following:
> [Update] since we have backward compatibility issue with resolving to a
> different type, we will not go with the modify type option.
> - -Automatically resolve that:-
> -1. *{{ObjectArrayTypeInfo<BasicTypeInfo.STRING>}}* to be the result type.-
> -2. *{{MapTypeInfo<BasicTypeInfo.STRING, BasicTypeInfo.INTEGER>}}* to be the
> parameter type.-
> - Improved function mapping to find and locate function with such signatures
> ** Change the following method to relax the
> check:*UserDefinedFunctionUtils.{{*getUserDefinedMethod*}}*
> ** *{{UserDefinedFunctionUtils.}}{{getEvalMethodSignature}}*
> -
> During compilation, should do the following:
> - Consistent resolution for: (Scala.Map / java.util.Map) and (Scala.Seq /
> Java array)
> - Automatically ingest type cast function (see FLINK-9430) to match the
> correct type, or automatically generate the counter part of the corresponding
> Scala / Java implementation of the eval function.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)